开发者

Is it possible to name database tables like Java types?

I want to tables of RDBMS like the names of Java types. Example:

mytld.mycompany.myproject.mypackage.mysubpackage.MyClass

Currently I am trying to do this with PostgreSQL. It gives me this error:

FEHLER: falscher qualifizierter Name (zu viele Namensteile): mytld.mycompany.myproject.mypackage.mysubpackage.MyClass

In English this means something like:

ERROR: wrong qualified name (to much name parts): mytld.mycompany.myproject.mypackage.mysubpackage.MyClass

  • Wasn'开发者_开发知识库t there something like database objects which could be referenced with punctuation names?
  • I also may be able to substitute the "." by another character. Is there any robust algorithm to do this?
  • Is there a way to use the exact Java class names as database tables?


You'd have to have it in quotes with a limit of 63 characters

"mytld.mycompany.myproject.mypackage.mysubpackage.MyClass"

Personally, I wouldn't do this. Your database is not the java code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜