[ http://jira.andromda.org/browse/HIB-184?page=comments#action_13702 ]
Diane Yang commented on HIB-184: -------------------------------- Actually, I just realized that it's probably because somewhere the column name length is set to a maximum of 30 characters. It just so happens that 30 is the cutoff before the property, which is why I was confused. Where does one set the maximum column name length? On another note, when the first level embedded value has multiple properties, each property (which is an embedded value) gets the path of the previous property appended to its column name. Why is that? If you had many properties, the column names for the last property would be huge. For example, for the first property's columns, the column names look like: FIRSTLEVELCLASS_FIRSTLEVELPROPERTY1_SECONDLEVELPROPERTY1, FIRSTLEVELCLASS_FIRSTLEVELPROPERTY1_SECONDLEVELPROPERTY2, etc. However, the second property's columns look like: FIRSTLEVELCLASS_FIRSTLEVELPROPERTY1_FIRSTLEVELPROPERTY2_SECONDLEVELPROPERTY1, FIRSTLEVELCLASS_FIRSTLEVELPROPERTY1_FIRSTLEVELPROPERTY2_SECONDLEVELPROPERTY2, etc. Instead, the desired column names for the second property would be: FIRSTLEVELCLASS_FIRSTLEVELPROPERTY2_SECONDLEVELPROPERTY1, FIRSTLEVELCLASS_FIRSTLEVELPROPERTY2_SECONDLEVELPROPERTY2, etc. > Duplicate Column names generated if EmbeddedValue containing another > EmbeddedValue is referenced twice > ------------------------------------------------------------------------------------------------------ > > Key: HIB-184 > URL: http://jira.andromda.org/browse/HIB-184 > Project: Hibernate Cartridge > Type: Bug > Versions: 3.2-RC1 > Environment: All > Reporter: Ronald Tschalär > Assignee: Carlos Cuenca > Fix For: 3.2-RC1 > Attachments: hibernate.patch.zip, hibernate_bug.jpg > > Assume you have an Entity A with two attributes, a1 and a2, both with > the same type which is an EmbeddedValue B; furthermore, assume that B > contains an attribute b1 of type another EmbeddedValue C (with some > attribute c1). Andromda will then generate two columns in the > hibernate descriptor for a1.b1.c1 and a2.b1.c1 but give them both the > same column name b1.c1 . > The problem is that the prefix used for to generate the column names > only contains the parent-attribute's name, but needs to include the > complete ancestor list in order to make it unique. Attached is a > simple patch, plus modified test case (see the SecondLevelEmbeddedType > class). > Attached is also a diagram excerpt from the test-case showing the > three relevant classes. Before the patch the column names generated > were both ATTR4_ATTR, and with the patch the names are > FIRST_EMBEDDED_ATTR4_ATTR and SECOND_EMBEDDED_ATTR4_ATTR. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.andromda.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV