- This topic has 6 replies, 3 voices, and was last updated 20 years, 2 months ago by support-jeff.
-
AuthorPosts
-
slepitMemberHi,
I am using the DB explorer to generate my hibernate classes, but it does not keep all the uppercase letters of the table and of the columns.
For instance for table MyTable and columns MyColumn1, MyColumn2,
it generates a class Mytable.java with attributes Mycolumn1, Mycolumn2 and getters getMycolumn1(), getMycolumn2().
I would have expected it to generate MyTable.java with attributes MyColumn1, MyColumn2 and getters getMyColumn1(), getMyColumn2().sandy
snpeMemberI don’t sure for your database, but differnet databases save object name in different way
for instance – oracle save object name in all upper case, postgresl in lower case (You can cretae table with “MyTable”, but it is hard support in this databases)
There is many method in DatabaseMetadata for check this behaviorTools can do the best for different databases – I think that ME have to have possiblity that use choose class name
regards
support-jeffMemberPlans are in the works for just such support. Right now, the only pattern that the Hibernate Tool knows is underscores, e.g. My_Table would become MyTable, but MyTable becomes Mytable (everything gets lowercased and then Java canonicalized)
snpeMemberit is bad design for table name like Mytable (mix upper and lower case ), special if You want cross databases – for class it is fine
Jeff, I think that is better if You make choice for class name for us
regards
support-jeffMemberYou are being facetious of course, correct? 😉
snpeMemberfor what – assertion one or two ?
one) you don’t know if you choose another database, tomorrow , correct ?
If You choose postgresql or oracle then it is problem mix upper and lower case
This query don’t work
select * from MyTablepostgres thin that is ‘mytable’, oracle ‘MYTABLE’
You have to write select * from “MyTable” – it is same for any objecttwo) what is a problem if we have choice for name of persistent class
my favorite hibernate tools currently (middlegen) have this featuresregards
support-jeffMember#1 I completely agree. Use of underscores to separate “words” is an unwritten SQL standard (read this as common practice)
#2 No problem at all, you just don’t get that feature with 3.8 GA. You will have to wait for the next iteration of feature development. Hopefully, if I get my way, your wait will be well worth it.
-
AuthorPosts