From: <no...@at...> - 2005-08-18 16:34:04
|
The following comment has been added to this issue: Author: Martin Zdila Created: Thu, 18 Aug 2005 11:31 AM Body: Hello > I'm not at all sure that use of <key-many-to-one> with XML is a good thing. Why? Imagine this hibernate mapping: <hibernate-mapping> <class name="com.kovine.kfe.dao.Widget" table="KFE_WIDGET" abstract="true" lazy="false"> ... <many-to-one unique="true" name="labelMessageKey" column="LABEL_KEY_ID" not-null="true" cascade="all" class="com.kovine.kfe.dao.MessageKey" /> ... </class> <class name="com.kovine.kfe.dao.MessageKey" table="KFE_MESSAGE_KEY"> <id name="id" column="MESSAGE_KEY_ID" node="@id"> <generator class="native"> <param name="sequence">KFE_MESSAGE_KEY_ID_SEQ</param> </generator> </id> <property name="key" column="MESSAGE_KEY" not-null="false" unique="true"/> <map name="messages" cascade="all" inverse="true" order-by="LANGUAGE_ID"> <key column="MESSAGE_KEY_ID" /> <map-key type="java.lang.String" formula="LANGUAGE_ID" /> <one-to-many class="com.kovine.kfe.dao.Message" /> </map> </class> <class name="com.kovine.kfe.dao.Message" table="KFE_MESSAGE"> <composite-id> <key-many-to-one name="language" column="LANGUAGE_ID" class="com.kovine.kfe.dao.Language" /> <key-many-to-one name="messageKey" column="MESSAGE_KEY_ID" class="com.kovine.kfe.dao.MessageKey" /> </composite-id> <property name="value" column="MESSAGE_VALUE" length="255" /> </class> <class name="com.kovine.kfe.dao.Language" table="KFE_LANGUAGE" mutable="false"> <id name="id" unsaved-value="null" column="LANGUAGE_ID" node="@id" /> <property name="code" column="CODE" length="3" not-null="true" /> <property name="language" column="LANGUAGE" length="32" not-null="true" /> </class> </hibernate-mapping> It would be just fine if the generated XML was: ... <labelMessageKey id="776"> <messages> <Message> <language id="en" /> <messageKey id="776" /> <value>Thing</value> </Message> <Message> <language id="de" /> <messageKey id="776" /> <value>Sache</value> <Message> <Message> <language id="sk" /> <messageKey id="776" /> <value>Vec</value> <Message> </messages> </labelMessageKey> ... Please look at this issue (priority = at least medium ;-) ). -- Martin Zdila --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-446?page=comments#action_19395 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-446 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-446 Summary: The is no possibility to specify embed-xml on key-many-to-one tag Type: Improvement Status: Unassigned Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Versions: 3.0.2 Assignee: Reporter: Markus Jessenitschnig Created: Fri, 6 May 2005 10:38 AM Updated: Thu, 18 Aug 2005 11:31 AM Environment: MySQL Description: It is not possible to specify embed-xml="false" on key-many-to-one tags within composite-id tag like it is possible for many-to-one relations. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |