Title:
Bug 77857:When using Hibernate, I love letting it build my tables for me, and, regularly simply opt for ’whatever Hibernate thinks is best’, in terms of table and column naming, rather than defining the name fo
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Mark Mandel / Mark Mandel (mark.mandel)
Created: 06/11/2009
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 241236
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Problem:
When using Hibernate, I love letting it build my tables for me, and, regularly simply opt for ’whatever Hibernate thinks is best’, in terms of table and column naming, rather than defining the name for every column of every table.
I figure, at the end of the day, I don’t really care what they are called, as long as they are readable and consistent. Adding indexes and the like after the fact are easy enough to do in either Annotations, or through the import.sql
So I found it weird when defining the a manytomany collection to have to do all this:
<cfproperty name="instruments" hint="Array of instruments" singularname="instrument" fieldtype="many-to-many" collectiontype="array" cfc="com.Instrument" linktable="musician_instrument" FKColumn="musicianID" inversejoincolumn="instrumentID" orderby="name">
I would have thought that I could have done:
<cfproperty name="instruments" hint="Array of instruments" singularname="instrument" fieldtype="many-to-many" collectiontype="array" cfc="com.Instrument" orderby="name">
Removing the linktable, fkcolumn and inversejoincolumn, and have Hibernate pick suitable defaults for me.
Except that it errors out.
I haven’t tested the other relationship types yet, but similar approaches are really nice when you are starting from scratch with an empty database.
This also applies to other relationships, one-to-one, one-to-many and many-to-one, and also mapping Collections as well.
Method:
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3038875
External Customer Info:
External Company:
External Customer Name: Mark Mandel
External Customer Email: 3EA9517D445A9E8999201549
External Test Config: 06/11/2009
Attachments:
Comments: