From: <leg...@at...> - 2003-08-11 03:57:14
|
The following comment has been added to this issue: Author: abe zafar Created: Sun, 10 Aug 2003 10:56 PM Body: I did try the inherit=false but that did not work because I got an error saying that the composite-id does not allow the meta-tag. If the composite-id did allow the meta tag then I agree with you, it would work. I don't know how to reopen this issue, so hopefully you will get my message. Thank you, --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-242 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-242 Summary: <meta attribute="implements"> does not behave as expected Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.1 Assignee: Reporter: abe zafar Created: Sun, 10 Aug 2003 2:40 AM Updated: Sun, 10 Aug 2003 6:37 AM Environment: JDK1.4 Description: If the tag <meta attribute="implements">com.hp.Printer</meta> is inserted as a child of the class tag it properly adds the implement clause to the class. But if that class also contained a <composite-id> tag which indicated a class then that class would also UNEXPECTEDLY implement the interface "com.hp.Printer". So in the following example: <class name="com.hp.ColorPrinter"> <meta attribute="implements">com.hp.Printer</meta> <composite-id name="propertyName" class="com.hp.PrinterId"> <key-property name="propertyName" type="typename" column="column_name"/> <key-many-to-one name="propertyName class="ClassName" column="column_name"/> </composite-id> Both "ColorPrinter" and "PrinterId" end up implementing "com.hp.Printer". ColorPrinter is expected to implement the interface, but PrinterId should not implement the interface. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-08-11 09:40:14
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Mon, 11 Aug 2003 4:39 AM Body: the inherit="false" should be set on the meta tag for the class - not composite id. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-242 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-242 Summary: <meta attribute="implements"> does not behave as expected Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.1 Assignee: Reporter: abe zafar Created: Sun, 10 Aug 2003 2:40 AM Updated: Sun, 10 Aug 2003 6:37 AM Environment: JDK1.4 Description: If the tag <meta attribute="implements">com.hp.Printer</meta> is inserted as a child of the class tag it properly adds the implement clause to the class. But if that class also contained a <composite-id> tag which indicated a class then that class would also UNEXPECTEDLY implement the interface "com.hp.Printer". So in the following example: <class name="com.hp.ColorPrinter"> <meta attribute="implements">com.hp.Printer</meta> <composite-id name="propertyName" class="com.hp.PrinterId"> <key-property name="propertyName" type="typename" column="column_name"/> <key-many-to-one name="propertyName class="ClassName" column="column_name"/> </composite-id> Both "ColorPrinter" and "PrinterId" end up implementing "com.hp.Printer". ColorPrinter is expected to implement the interface, but PrinterId should not implement the interface. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-08-11 17:19:40
|
The following comment has been added to this issue: Author: abe zafar Created: Mon, 11 Aug 2003 12:05 PM Body: Maybe this example will make my point more clear: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="com.rhi.domain.impl.Person" table="people"> <meta attribute="implements">com.rhi.domain.Person</meta> <composite-id name="pk" class="com.rhi.domain.impl.id.PersonPk"> <key-property name="personId" column="person_id" type="java.lang.Long"/> <key-property name="personRegionId" column="person_region_id" type="java.lang.Long"/> </composite-id> <property name="number" column="people_no" type="java.lang.Long"/> <property name="firstName" column="first_name" type="java.lang.String"/> <property name="middleName" column="middle_name" type="java.lang.String"/> <property name="lastName" column="last_name" type="java.lang.String"/> </class> </hibernate-mapping> The intention in this example is that the class "com.rhi.domain.impl.Person" should implement the interface "com.rhi.domain.Person" and the class "com.rhi.domain.impl.id.PersonPk" should NOT implement any interfaces. But what happens is both classes "com.rhi.domain.impl.Person" and "com.rhi.domain.impl.id.PersonPk" end up implementing "com.rhi.domain.Person". Now you are suggesting to put inherit="false" at the class level but that doesn't do what I need because I still want "com.rhi.domain.impl.Person" to implement the interface "com.rhi.domain.Person". --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-242 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-242 Summary: <meta attribute="implements"> does not behave as expected Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.1 Assignee: Reporter: abe zafar Created: Sun, 10 Aug 2003 2:40 AM Updated: Sun, 10 Aug 2003 6:37 AM Environment: JDK1.4 Description: If the tag <meta attribute="implements">com.hp.Printer</meta> is inserted as a child of the class tag it properly adds the implement clause to the class. But if that class also contained a <composite-id> tag which indicated a class then that class would also UNEXPECTEDLY implement the interface "com.hp.Printer". So in the following example: <class name="com.hp.ColorPrinter"> <meta attribute="implements">com.hp.Printer</meta> <composite-id name="propertyName" class="com.hp.PrinterId"> <key-property name="propertyName" type="typename" column="column_name"/> <key-many-to-one name="propertyName class="ClassName" column="column_name"/> </composite-id> Both "ColorPrinter" and "PrinterId" end up implementing "com.hp.Printer". ColorPrinter is expected to implement the interface, but PrinterId should not implement the interface. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-08-12 08:23:14
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Tue, 12 Aug 2003 3:22 AM Body: Have you tried adding insert="false" to the meta attribute in the class ? It may surprise you to see that what happens is that the class GETS the meta tag (as it is in the class), but the meta tag is NOT inherited by any sub-tags. Please say if you have tried it and it then did not work, because then we have a bug - and then i would like to see you hbm.xml which does not work. Here is what i expect you to do ;) <class name="com.rhi.domain.impl.Person" table="people"> <meta inherit="false" attribute="implements">com.rhi.domain.Person</meta> <composite-id name="pk" class="com.rhi.domain.impl.id.PersonPk"> <key-property name="personId" column="person_id" type="java.lang.Long"/> <key-property name="personRegionId" column="person_region_id" type="java.lang.Long"/> </composite-id> <property name="number" column="people_no" type="java.lang.Long"/> <property name="firstName" column="first_name" type="java.lang.String"/> <property name="middleName" column="middle_name" type="java.lang.String"/> <property name="lastName" column="last_name" type="java.lang.String"/> </class> --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-242 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-242 Summary: <meta attribute="implements"> does not behave as expected Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.1 Assignee: Reporter: abe zafar Created: Sun, 10 Aug 2003 2:40 AM Updated: Sun, 10 Aug 2003 6:37 AM Environment: JDK1.4 Description: If the tag <meta attribute="implements">com.hp.Printer</meta> is inserted as a child of the class tag it properly adds the implement clause to the class. But if that class also contained a <composite-id> tag which indicated a class then that class would also UNEXPECTEDLY implement the interface "com.hp.Printer". So in the following example: <class name="com.hp.ColorPrinter"> <meta attribute="implements">com.hp.Printer</meta> <composite-id name="propertyName" class="com.hp.PrinterId"> <key-property name="propertyName" type="typename" column="column_name"/> <key-many-to-one name="propertyName class="ClassName" column="column_name"/> </composite-id> Both "ColorPrinter" and "PrinterId" end up implementing "com.hp.Printer". ColorPrinter is expected to implement the interface, but PrinterId should not implement the interface. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-08-12 17:24:01
|
The following comment has been added to this issue: Author: abe zafar Created: Tue, 12 Aug 2003 12:17 PM Body: Thanks that works. By changing the meta tag from: <meta attribute="implements">com.rhi.domain.Person</meta> to: <meta inherit="false" attribute="implements">com.rhi.domain.Person</meta> The interface gets only implemented by the class indicated in the class tag. I personally think this feature of inherting the meta tag is not very intuitive. I don't think very often one wants all its classes to implement the same interface or pass another meta attribute to all its classes and methods. I think it would be more intuitive if the meta tag is applied to only the tags which it is a direct child of. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-242 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-242 Summary: <meta attribute="implements"> does not behave as expected Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.1 Assignee: Reporter: abe zafar Created: Sun, 10 Aug 2003 2:40 AM Updated: Sun, 10 Aug 2003 6:37 AM Environment: JDK1.4 Description: If the tag <meta attribute="implements">com.hp.Printer</meta> is inserted as a child of the class tag it properly adds the implement clause to the class. But if that class also contained a <composite-id> tag which indicated a class then that class would also UNEXPECTEDLY implement the interface "com.hp.Printer". So in the following example: <class name="com.hp.ColorPrinter"> <meta attribute="implements">com.hp.Printer</meta> <composite-id name="propertyName" class="com.hp.PrinterId"> <key-property name="propertyName" type="typename" column="column_name"/> <key-many-to-one name="propertyName class="ClassName" column="column_name"/> </composite-id> Both "ColorPrinter" and "PrinterId" end up implementing "com.hp.Printer". ColorPrinter is expected to implement the interface, but PrinterId should not implement the interface. --------------------------------------------------------------------- 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 |
From: <leg...@at...> - 2003-08-13 07:39:29
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Wed, 13 Aug 2003 2:16 AM Body: well - then you just use the inherit="false" on every meta tag you got. I agree that sometimes the ineritance does not make sense, but at other times it does (like scope-get, scope-field etc.) The default of having inherit="true" was made after asking the community what they thought - should i change the default behavior of meta (breaking existing code) ? And guess what, noone answered ;) So, i kept the default. But please, make an jira issue on the subject and then if it gets enough votes i'll consider changing the default. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-242 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-242 Summary: <meta attribute="implements"> does not behave as expected Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.1 Assignee: Reporter: abe zafar Created: Sun, 10 Aug 2003 2:40 AM Updated: Sun, 10 Aug 2003 6:37 AM Environment: JDK1.4 Description: If the tag <meta attribute="implements">com.hp.Printer</meta> is inserted as a child of the class tag it properly adds the implement clause to the class. But if that class also contained a <composite-id> tag which indicated a class then that class would also UNEXPECTEDLY implement the interface "com.hp.Printer". So in the following example: <class name="com.hp.ColorPrinter"> <meta attribute="implements">com.hp.Printer</meta> <composite-id name="propertyName" class="com.hp.PrinterId"> <key-property name="propertyName" type="typename" column="column_name"/> <key-many-to-one name="propertyName class="ClassName" column="column_name"/> </composite-id> Both "ColorPrinter" and "PrinterId" end up implementing "com.hp.Printer". ColorPrinter is expected to implement the interface, but PrinterId should not implement the interface. --------------------------------------------------------------------- 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 |