You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
(175) |
Jul
(209) |
Aug
(302) |
Sep
(287) |
Oct
(339) |
Nov
(314) |
Dec
(329) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(479) |
Feb
(389) |
Mar
(599) |
Apr
(307) |
May
(390) |
Jun
(300) |
Jul
(410) |
Aug
(458) |
Sep
(299) |
Oct
(315) |
Nov
(363) |
Dec
(529) |
2005 |
Jan
(568) |
Feb
(434) |
Mar
(1004) |
Apr
(823) |
May
(767) |
Jun
(763) |
Jul
(854) |
Aug
(862) |
Sep
(560) |
Oct
(853) |
Nov
(763) |
Dec
(731) |
2006 |
Jan
(776) |
Feb
(608) |
Mar
(657) |
Apr
(424) |
May
(559) |
Jun
(440) |
Jul
(448) |
Aug
(58) |
Sep
|
Oct
(17) |
Nov
(16) |
Dec
(8) |
2007 |
Jan
(1) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
(3) |
Jun
(3) |
Jul
(3) |
Aug
(16) |
Sep
(10) |
Oct
(4) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <leg...@at...> - 2003-12-10 06:23:16
|
Message: The following issue has been closed. Resolver: Gavin King Date: Wed, 10 Dec 2003 12:21 AM Closing this, since I don't believe it, and user couldn't provide evidence. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-526 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-526 Summary: Problem finding records with compound primary keys Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: David R Robison Created: Fri, 5 Dec 2003 7:53 AM Updated: Wed, 10 Dec 2003 12:21 AM Environment: postgresql on W2K Description: I'm trying to find a record with a compound key. The following is my session.find call: Session hbSession = HibernateSession.currentSession(); types = hbSession.find("from com.orci.ITSAM.hibernate.SegmentType sgType " + "where sgType.comp_id.siteDatabase.comp_id.site = ? " + "and sgType.comp_id.siteDatabase.comp_id.dbId = ? ", new Object[] { SiteDatabaseServices.MyDbSiteCode(context), SiteDatabaseServices.MyDbId(context) }, new Type[] { Hibernate.INTEGER, Hibernate.INTEGER }); I'v set show_sql to true. When this line is executed, the following SQL statement prints: select segmenttyp0_.sg_type_code as sg_type_1_, segmenttyp0_.sg_db_site as sg_db_site, segmenttyp0_.sg_db_id as sg_db_id, segmenttyp0_.name as name, segmenttyp0_.default_mnemonic as default_5_, segmenttyp0_.gmt_last_updated as gmt_last6_, segmenttyp0_.rstat_type_code as rstat_ty7_, segmenttyp0_.last_upd_db_site as last_upd8_, segmenttyp0_.last_upd_db_id as last_upd9_ from segment_type segmenttyp0_ where (segmenttyp0_.sg_db_id=? )and(segmenttyp0_.sg_db_site=? ) What is interesting is that the WHERE clause checks the site first and then the dbId but in the printed SQL statement, the WHERE clause is db_id first and then site. This causes problems with the parameters passed into the find call. Any ideas why the SQL WHERE clause is being rearanged? Thanks, David Robison --------------------------------------------------------------------- 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-12-10 05:54:19
|
The following issue has been updated: Updater: Konstantin Sharenkov (mailto:kon...@en...) Date: Tue, 9 Dec 2003 11:52 PM Changes: Attachment changed to screen.gif --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:52 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-10 05:52:18
|
The following issue has been updated: Updater: Konstantin Sharenkov (mailto:kon...@en...) Date: Tue, 9 Dec 2003 11:51 PM Changes: Attachment changed to UserType.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:51 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-10 05:52:18
|
The following issue has been updated: Updater: Konstantin Sharenkov (mailto:kon...@en...) Date: Tue, 9 Dec 2003 11:51 PM Changes: Attachment changed to GenericEnum.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:51 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-10 05:52:17
|
The following issue has been updated: Updater: Konstantin Sharenkov (mailto:kon...@en...) Date: Tue, 9 Dec 2003 11:50 PM Changes: Attachment changed to Persistent.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:50 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-10 05:52:17
|
The following issue has been updated: Updater: Konstantin Sharenkov (mailto:kon...@en...) Date: Tue, 9 Dec 2003 11:50 PM Changes: Attachment changed to User.hbm.xml --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:50 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-10 05:50:18
|
The following issue has been updated: Updater: Konstantin Sharenkov (mailto:kon...@en...) Date: Tue, 9 Dec 2003 11:50 PM Changes: Attachment changed to User.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:50 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-10 05:50:18
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-535 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-535 Summary: 2.1 rc1 CGLIB2 Proxy Problems. Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 rc1 Assignee: Reporter: Konstantin Sharenkov Created: Tue, 9 Dec 2003 11:49 PM Updated: Tue, 9 Dec 2003 11:49 PM Environment: WinXP tomcat 4.1.27, jdk 1.4.1, Description: After i moved to 2.1 RC1 form 2.1 beta 3 i have following issue if class is lazy <class .... lazy="true"> and I obtain instance obj = sess.load( XXX.class, ID ) if instance is proxy 1. obj.getId() always returns 0 2. getter for other persistent obj.getPersistent() always returns null 3. getter for persistent enum obj.getEnum() always return value for constant Enum.fromInt(0) if i set lazy="false" ol works correct if i use previous verison library all correct too. the sample for id and Persistent Enum included see User.getType, User.getId() and Screenshoots --------------------------------------------------------------------- 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-12-09 22:52:17
|
The following comment has been added to this issue: Author: Gavin King Created: Tue, 9 Dec 2003 4:51 PM Body: Please resubmit this as a patch, so that we can see exactly which lines changed. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-534 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-534 Summary: Table schema use in DatabaseMetadata Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: xfgdf Created: Tue, 9 Dec 2003 10:55 AM Updated: Tue, 9 Dec 2003 4:51 PM Environment: Hibernate 2.1 beta 4, Oracle 8i Description: When using SchemaUpdate, the DatabaseMetaData.getTableMetadata() looks for a table with the correct table name in any database schema and it take the first one it found. This behavior is uncorrect if I have a table existing in different schemas. The correct behavior would be to first look in the schema with the login name and after in any schema. user1.article user2.article I connected whith user2, DatabaseMetaData should first look for user2.article, then if not found to %.article. Adrien --------------------------------------------------------------------- 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-12-09 22:42:18
|
The following comment has been added to this issue: Author: Gavin King Created: Tue, 9 Dec 2003 4:41 PM Body: OK, I added a test at startup time. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-527 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-527 Summary: Session.find throws ClassCastException when composite id is used and Class not Serializable Type: Improvement Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Fix Fors: 2.1 final Versions: 2.1 rc1 Assignee: Reporter: John Caruso Created: Fri, 5 Dec 2003 9:18 AM Updated: Tue, 9 Dec 2003 4:41 PM Environment: Hibernate 2.1 rc1, Oracle 8.1.7 Description: Loader.java (line 347) resultId = (Serializable) idType.nullSafeGet(rs, suffixedKeyColumns[i], session, null); //problematic for <key-many-to-one>! The API docs say that session.find(String query) throws only a Hibernate Exception. The ClassCast Exception is thrown and perhaps can be avoided by using isAssignableFrom(java.io.Serializable.class) first and throwing a HibernateException describing that the class doesn't implement Serializable when it should. (This took me a while to figure out before actually going into the hibernate source code to find the source of the error) I apologize if this bug is already known, however, I do not have time to cruise through the bug reports. Hibernate is a godsend. Keep up the good work! ;) --------------------------------------------------------------------- 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-12-09 22:42:17
|
Message: The following issue has been closed. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-527 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-527 Summary: Session.find throws ClassCastException when composite id is used and Class not Serializable Type: Improvement Status: Closed Priority: Minor Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 final Versions: 2.1 rc1 Assignee: Reporter: John Caruso Created: Fri, 5 Dec 2003 9:18 AM Updated: Tue, 9 Dec 2003 4:41 PM Environment: Hibernate 2.1 rc1, Oracle 8.1.7 Description: Loader.java (line 347) resultId = (Serializable) idType.nullSafeGet(rs, suffixedKeyColumns[i], session, null); //problematic for <key-many-to-one>! The API docs say that session.find(String query) throws only a Hibernate Exception. The ClassCast Exception is thrown and perhaps can be avoided by using isAssignableFrom(java.io.Serializable.class) first and throwing a HibernateException describing that the class doesn't implement Serializable when it should. (This took me a while to figure out before actually going into the hibernate source code to find the source of the error) I apologize if this bug is already known, however, I do not have time to cruise through the bug reports. Hibernate is a godsend. Keep up the good work! ;) --------------------------------------------------------------------- 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-12-09 22:27:27
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 9 Dec 2003 4:27 PM This is possible in Hibernate 2.2. (Already implemented in CVS.) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-529 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-529 Summary: mapping a class with several tables? Type: Improvement Status: Closed Priority: Major Resolution: DUPLICATE Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Reporter: LiMo Created: Sat, 6 Dec 2003 8:12 AM Updated: Tue, 9 Dec 2003 4:27 PM Environment: rc1, mysql Description: can I make a class associate with several similar table ? It is a big problem for me. my project is a refactoring project to a old system. in the old system, we create a table by each year. such as: TBL_NEWS_2003, TBL_NEWS_2002 so when we need search in years, we use UNION to select from all table. BUT how can i do this in hibernate?? The situation is: When one develop a website such as a news website. It its very easy to decide making a generic News.class to fit for all kinds of news. eg. A news may have title, content, date ... so we develop a News.class. but we have different news, like entertaiment, sport, government, techinical ..... so, we must have dynamically mapping to News.class News.class should associate to several *.hbm.xml file, each file figure to a table. like News.sport.hbm.xml, News.entertaiment.hbm.xml (May be we can specify the different table name just in the filename) and the Configuaration can read all xml and one can query News.class in all different table or only one table. BUT actually I must make a News.hbm.xml for it. and i wrtie table name in the XML. OR when i query some news, can I specify a tablename or modualname parameter to the Session and get the same News.class from different table. can i make myself understand? Anyone who can give me the solution?? Thank you! --------------------------------------------------------------------- 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-12-09 22:27:19
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 9 Dec 2003 4:26 PM You have one instance variable which is used by to two different properties, one on the superclass, one on the subclass. Please use the user forum for these kind of problems. JIRA is for bugs in Hibernate. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-533 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-533 Summary: Bidirectional Parent / Child relationship between a class and a joined-subclass gets deleted by saveOrUpdate Type: Bug Status: Closed Priority: Minor Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Gavin King Reporter: Gary Miller Created: Tue, 9 Dec 2003 8:50 AM Updated: Tue, 9 Dec 2003 4:26 PM Environment: JDK 1.4.0-b92 postgres 7.3.4 Description: The child to parent reference get set to null when an existing graph is retrieved from the DB and then saveOrUpdate is called with no changes made to the graph. The following example illustrates the point. There is a work around which is to effectively disable the setParent method if the parent provided is null. This section of code is commented out in the example. I have run this code up in a debugger but don't know how to debug a cglib generated class. I new to hibernate, please let me know how I could have improved my post. Regards Gary Miller Class hierarchy Model | --------- | | Root NodeElem | ----------- | | Node Leaf Object Graph root -> nodes node -> nodeelems All these relationships are bidirectional Therefore a node's parent can either be a Root or a NodeElem. Mapping File test.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="net.sf.hibernate.examples.Root" table="eg_root" dynamic-update="false" dynamic-insert="false"> <id name="id" column="id" type="java.lang.String" unsaved-value="null"> <generator class="uuid.hex"/> </id> <version name="version" type="int" column="version"/> <bag name="nodes" lazy="false" inverse="true" cascade="save-update"> <key column="root_id"/> <one-to-many class="net.sf.hibernate.examples.Node"/> </bag> </class> <class name="net.sf.hibernate.examples.NodeElem" table="eg_nodeelem" dynamic-update="false" dynamic-insert="false"> <id name="id" column="id" type="java.lang.String" unsaved-value="null"> <generator class="uuid.hex"/> </id> <version name="version" type="int" column="version"/> <many-to-one name="parentNodeElem" column="node_id" not-null="false" cascade="save-update"/> <joined-subclass name="net.sf.hibernate.examples.Node" table="eg_node" dynamic-update="false" dynamic-insert="false"> <key column="id"/> <many-to-one name="parentRoot" column="root_id" not-null="false" cascade="save-update"/> <bag name="nodeElem" table="NodeElem" lazy="false" inverse="true" cascade="save-update"> <key column="node_id"/> <one-to-many class="net.sf.hibernate.examples.NodeElem"/> </bag> </joined-subclass> <joined-subclass name="net.sf.hibernate.examples.Leaf" table="eg_leaf" dynamic-update="false" dynamic-insert="false"> <key column="id"/> <property name="name" type="java.lang.String" update="true" insert="true" column="name"/> </joined-subclass> </class> </hibernate-mapping> Test Classes sf.net.hibernate.example.Main ----------------------------- package net.sf.hibernate.examples; import java.util.Iterator; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Transaction; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.cfg.Environment; /** * @author garym * Main */ public class Main { static void print( Root r ) { System.out.println( r ); for( Iterator it = r.getNodes().iterator() ; it.hasNext() ; ) { Node n = (Node) it.next(); recurseNode( n , "\t" ); } } static void recurseNode( Node n , String pretty ) { System.out.println( pretty + n.toString() + "\t parent:" + n.getParent() ); for( Iterator it2 = n.getNodeElem().iterator(); it2.hasNext() ; ) { NodeElem ne = (NodeElem) it2.next(); if( ne instanceof Node ) recurseNode( (Node) ne , pretty + "\t" ); else System.out.println( pretty + "\t" + ne.toString() + "\t parent:" + ne.getParent() ); } } public static void main(String[] args) throws Exception { SessionFactory sessionFactory = new Configuration() .configure( "/net/sf/hibernate/examples/hibernate.cfg.xml" ) // .setProperty(Environment.HBM2DDL_AUTO, "create") .buildSessionFactory(); // for( int i = 0 ; i < 1 ; i++ ) { Session session = sessionFactory.openSession(); // Root r = null; Query query = session.createQuery("select r from Root as r"); Iterator it = query.iterate(); if( it.hasNext() ) { r = (Root) it.next(); System.out.println("Retrieved" ); Iterator it2 = r.getNodes().iterator(); if( it2.hasNext() ) { Node n = (Node) it2.next(); Node n2 = new Node(); n2.addNodeElem( new Leaf("new") ); n.addNodeElem( n2 ); } print(r); } else { System.out.println("No Root found" ); r = new Root(); Node n = new Node(); n.addNodeElem( new Leaf("Moe") ); n.addNodeElem( new Leaf("Curly") ); n.addNodeElem( new Leaf("Larry") ); r.addNode( n ); print( r ); } Transaction xaction= session.beginTransaction(); System.out.println("Started Trans" ); session.saveOrUpdate(r); System.out.println("Saved" ); xaction.commit(); System.out.println("Committed" ); session.close(); } sessionFactory.close(); } } Model ----- package net.sf.hibernate.examples; /** * @author garym * Model */ public class Model { String id; int ver; Model parent; void setParent( Model p ) { // THIS IS THE WORK AROUND // if( p == null ) { ////// parent = null; // return; // } if( parent != null && !p.equals(parent) ) throw new RuntimeException("Parent can only be set twice \nthis:'"+this+"'\nparent:'" + p + "'"); parent = p; } Model getParent( ) { return parent; } void setVersion( int v ) { ver = v; } int getVersion() { return ver; } void setId( String id ) { this.id = id; } String getId() { return id; } } Root ---- package net.sf.hibernate.examples; import java.util.ArrayList; import java.util.List; /** * @author garym * Root */ public class Root extends Model { List nodes; Root() {}; List getNodes() { return nodes; } void setNodes( List nodes ) { this.nodes = nodes; } void addNode( Node c ) { if(nodes == null) nodes = new ArrayList(); nodes.add(c); c.setParent( this ); } // public String toString() { // return nodes == null ? "[]" : nodes.toString(); // } } NodeElem -------- package net.sf.hibernate.examples; /** * @author garym */ public class NodeElem extends Model { void setParentNodeElem( NodeElem p ) { setParent(p); } NodeElem getParentNodeElem() { return (NodeElem) getParent(); } } Node ---- package net.sf.hibernate.examples; import java.util.ArrayList; import java.util.List; /** * @author garym */ public class Node extends NodeElem { List nodeElems; Node() {}; void setParentRoot( Root p ) { setParent(p); } Root getParentRoot() { Model p = getParent(); if( p instanceof Root ) return (Root) p; return null; } NodeElem getParentNodeElem() { Model p = getParent(); if( p instanceof NodeElem ) return (NodeElem) p; return null; } List getNodeElem() { return nodeElems; } void setNodeElem( List nodeElems ) { this.nodeElems = nodeElems; } void addNodeElem( NodeElem c ) { if(nodeElems == null) nodeElems = new ArrayList(); nodeElems.add(c); c.setParent( this ); } // public String toString() { // return nodeElems == null ? super.toString() + "[]" : super.toString() + nodeElems.toString(); // } } Leaf ---- package net.sf.hibernate.examples; /** * @author garym * Child */ public class Leaf extends NodeElem { String name; Leaf() {} Leaf( String name ) { setName(name); } void setName( String name ) { this.name = name; } String getName() { return name; } public String toString() { return "name:'" + name + "'"; } } --------------------------------------------------------------------- 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-12-09 18:15:18
|
The following issue has been updated: Updater: Finn McCann (mailto:mc...@du...) Date: Tue, 9 Dec 2003 12:13 PM Changes: Attachment changed to IDS9.4-Patch-to-Hibernate2.1.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-414&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-414 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-414 Summary: Informix dialect creates syntax errors in IDS 9.4 Type: Bug Status: Open Priority: Major Project: Hibernate2 Versions: 2.0.2 Assignee: Max Rydahl Andersen Reporter: Finn McCann Created: Tue, 21 Oct 2003 11:01 AM Updated: Tue, 9 Dec 2003 12:13 PM Environment: Hibernate2 on JDK1.4 on Win2000, talking via Informix JDBC 2.21.JC5 driver to Informix IDS 9.4 on another Windows 2000 box. Description: Having tested Informix dialect in Hibernate2 against Informix IDS v9.4, we found a couple of issues: 1. Serial ids: <id name="id" column="ID" length="32" unsaved-value="null"> <generator class="uuid.hex"/> </id> creates a data type: INT8 SERIAL instead of: SERIAL8 The "INT8 SERIAL" causes a syntax error in IDS 9.4. 2. Foreign Key constraint names: <set name="upliftRates" lazy="true" cascade="all" order-by="EFFECTIVE_DATE desc"> <key column="NETWORK_ID" length="32"/> <one-to-many class="com.capetechnologies.multinet.domain.UpliftRate"/> </set> creates this ALTER TABLE statement: alter table MULTINET_TAX_RATES add constraint FKE1700D046924EC foreign key (NETWORK_ID) references MULTINET_NETWORK instead of: alter table MULTINET_TAX_RATES add constraint foreign key (NETWORK_ID) references MULTINET_NETWORK constraint FKE1700D046924EC Having "CONSTRAINT <constraint name>" within the statement instead of at the end causes a syntax error. This also applies to adding UNIQUE CONSTRAINTs. --------------------------------------------------------------------- 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-12-09 18:13:19
|
The following comment has been added to this issue: Author: Finn McCann Created: Tue, 9 Dec 2003 12:13 PM Body: 2.1 patch added. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-414 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-414 Summary: Informix dialect creates syntax errors in IDS 9.4 Type: Bug Status: Open Priority: Major Project: Hibernate2 Versions: 2.0.2 Assignee: Max Rydahl Andersen Reporter: Finn McCann Created: Tue, 21 Oct 2003 11:01 AM Updated: Tue, 9 Dec 2003 12:13 PM Environment: Hibernate2 on JDK1.4 on Win2000, talking via Informix JDBC 2.21.JC5 driver to Informix IDS 9.4 on another Windows 2000 box. Description: Having tested Informix dialect in Hibernate2 against Informix IDS v9.4, we found a couple of issues: 1. Serial ids: <id name="id" column="ID" length="32" unsaved-value="null"> <generator class="uuid.hex"/> </id> creates a data type: INT8 SERIAL instead of: SERIAL8 The "INT8 SERIAL" causes a syntax error in IDS 9.4. 2. Foreign Key constraint names: <set name="upliftRates" lazy="true" cascade="all" order-by="EFFECTIVE_DATE desc"> <key column="NETWORK_ID" length="32"/> <one-to-many class="com.capetechnologies.multinet.domain.UpliftRate"/> </set> creates this ALTER TABLE statement: alter table MULTINET_TAX_RATES add constraint FKE1700D046924EC foreign key (NETWORK_ID) references MULTINET_NETWORK instead of: alter table MULTINET_TAX_RATES add constraint foreign key (NETWORK_ID) references MULTINET_NETWORK constraint FKE1700D046924EC Having "CONSTRAINT <constraint name>" within the statement instead of at the end causes a syntax error. This also applies to adding UNIQUE CONSTRAINTs. --------------------------------------------------------------------- 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-12-09 17:08:17
|
The following issue has been updated: Updater: xfgdf (mailto:sa...@ho...) Date: Tue, 9 Dec 2003 11:06 AM Comment: My proposal correction to the bug. Adrien Changes: Attachment changed to DatabaseMetadata.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-534&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-534 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-534 Summary: Table schema use in DatabaseMetadata Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: xfgdf Created: Tue, 9 Dec 2003 10:55 AM Updated: Tue, 9 Dec 2003 11:06 AM Environment: Hibernate 2.1 beta 4, Oracle 8i Description: When using SchemaUpdate, the DatabaseMetaData.getTableMetadata() looks for a table with the correct table name in any database schema and it take the first one it found. This behavior is uncorrect if I have a table existing in different schemas. The correct behavior would be to first look in the schema with the login name and after in any schema. user1.article user2.article I connected whith user2, DatabaseMetaData should first look for user2.article, then if not found to %.article. Adrien --------------------------------------------------------------------- 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-12-09 16:56:17
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-534 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-534 Summary: Table schema use in DatabaseMetadata Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: xfgdf Created: Tue, 9 Dec 2003 10:55 AM Updated: Tue, 9 Dec 2003 10:55 AM Environment: Hibernate 2.1 beta 4, Oracle 8i Description: When using SchemaUpdate, the DatabaseMetaData.getTableMetadata() looks for a table with the correct table name in any database schema and it take the first one it found. This behavior is uncorrect if I have a table existing in different schemas. The correct behavior would be to first look in the schema with the login name and after in any schema. user1.article user2.article I connected whith user2, DatabaseMetaData should first look for user2.article, then if not found to %.article. Adrien --------------------------------------------------------------------- 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-12-09 14:57:17
|
The following issue has been updated: Updater: Gary Miller (mailto:ga...@sb...) Date: Tue, 9 Dec 2003 8:56 AM Changes: Attachment changed to example_src.jar --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-533&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-533 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-533 Summary: Bidirectional Parent / Child relationship between a class and a joined-subclass gets deleted by saveOrUpdate Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Gary Miller Created: Tue, 9 Dec 2003 8:50 AM Updated: Tue, 9 Dec 2003 8:56 AM Environment: JDK 1.4.0-b92 postgres 7.3.4 Description: The child to parent reference get set to null when an existing graph is retrieved from the DB and then saveOrUpdate is called with no changes made to the graph. The following example illustrates the point. There is a work around which is to effectively disable the setParent method if the parent provided is null. This section of code is commented out in the example. I have run this code up in a debugger but don't know how to debug a cglib generated class. I new to hibernate, please let me know how I could have improved my post. Regards Gary Miller Class hierarchy Model | --------- | | Root NodeElem | ----------- | | Node Leaf Object Graph root -> nodes node -> nodeelems All these relationships are bidirectional Therefore a node's parent can either be a Root or a NodeElem. Mapping File test.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="net.sf.hibernate.examples.Root" table="eg_root" dynamic-update="false" dynamic-insert="false"> <id name="id" column="id" type="java.lang.String" unsaved-value="null"> <generator class="uuid.hex"/> </id> <version name="version" type="int" column="version"/> <bag name="nodes" lazy="false" inverse="true" cascade="save-update"> <key column="root_id"/> <one-to-many class="net.sf.hibernate.examples.Node"/> </bag> </class> <class name="net.sf.hibernate.examples.NodeElem" table="eg_nodeelem" dynamic-update="false" dynamic-insert="false"> <id name="id" column="id" type="java.lang.String" unsaved-value="null"> <generator class="uuid.hex"/> </id> <version name="version" type="int" column="version"/> <many-to-one name="parentNodeElem" column="node_id" not-null="false" cascade="save-update"/> <joined-subclass name="net.sf.hibernate.examples.Node" table="eg_node" dynamic-update="false" dynamic-insert="false"> <key column="id"/> <many-to-one name="parentRoot" column="root_id" not-null="false" cascade="save-update"/> <bag name="nodeElem" table="NodeElem" lazy="false" inverse="true" cascade="save-update"> <key column="node_id"/> <one-to-many class="net.sf.hibernate.examples.NodeElem"/> </bag> </joined-subclass> <joined-subclass name="net.sf.hibernate.examples.Leaf" table="eg_leaf" dynamic-update="false" dynamic-insert="false"> <key column="id"/> <property name="name" type="java.lang.String" update="true" insert="true" column="name"/> </joined-subclass> </class> </hibernate-mapping> Test Classes sf.net.hibernate.example.Main ----------------------------- package net.sf.hibernate.examples; import java.util.Iterator; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Transaction; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.cfg.Environment; /** * @author garym * Main */ public class Main { static void print( Root r ) { System.out.println( r ); for( Iterator it = r.getNodes().iterator() ; it.hasNext() ; ) { Node n = (Node) it.next(); recurseNode( n , "\t" ); } } static void recurseNode( Node n , String pretty ) { System.out.println( pretty + n.toString() + "\t parent:" + n.getParent() ); for( Iterator it2 = n.getNodeElem().iterator(); it2.hasNext() ; ) { NodeElem ne = (NodeElem) it2.next(); if( ne instanceof Node ) recurseNode( (Node) ne , pretty + "\t" ); else System.out.println( pretty + "\t" + ne.toString() + "\t parent:" + ne.getParent() ); } } public static void main(String[] args) throws Exception { SessionFactory sessionFactory = new Configuration() .configure( "/net/sf/hibernate/examples/hibernate.cfg.xml" ) // .setProperty(Environment.HBM2DDL_AUTO, "create") .buildSessionFactory(); // for( int i = 0 ; i < 1 ; i++ ) { Session session = sessionFactory.openSession(); // Root r = null; Query query = session.createQuery("select r from Root as r"); Iterator it = query.iterate(); if( it.hasNext() ) { r = (Root) it.next(); System.out.println("Retrieved" ); Iterator it2 = r.getNodes().iterator(); if( it2.hasNext() ) { Node n = (Node) it2.next(); Node n2 = new Node(); n2.addNodeElem( new Leaf("new") ); n.addNodeElem( n2 ); } print(r); } else { System.out.println("No Root found" ); r = new Root(); Node n = new Node(); n.addNodeElem( new Leaf("Moe") ); n.addNodeElem( new Leaf("Curly") ); n.addNodeElem( new Leaf("Larry") ); r.addNode( n ); print( r ); } Transaction xaction= session.beginTransaction(); System.out.println("Started Trans" ); session.saveOrUpdate(r); System.out.println("Saved" ); xaction.commit(); System.out.println("Committed" ); session.close(); } sessionFactory.close(); } } Model ----- package net.sf.hibernate.examples; /** * @author garym * Model */ public class Model { String id; int ver; Model parent; void setParent( Model p ) { // THIS IS THE WORK AROUND // if( p == null ) { ////// parent = null; // return; // } if( parent != null && !p.equals(parent) ) throw new RuntimeException("Parent can only be set twice \nthis:'"+this+"'\nparent:'" + p + "'"); parent = p; } Model getParent( ) { return parent; } void setVersion( int v ) { ver = v; } int getVersion() { return ver; } void setId( String id ) { this.id = id; } String getId() { return id; } } Root ---- package net.sf.hibernate.examples; import java.util.ArrayList; import java.util.List; /** * @author garym * Root */ public class Root extends Model { List nodes; Root() {}; List getNodes() { return nodes; } void setNodes( List nodes ) { this.nodes = nodes; } void addNode( Node c ) { if(nodes == null) nodes = new ArrayList(); nodes.add(c); c.setParent( this ); } // public String toString() { // return nodes == null ? "[]" : nodes.toString(); // } } NodeElem -------- package net.sf.hibernate.examples; /** * @author garym */ public class NodeElem extends Model { void setParentNodeElem( NodeElem p ) { setParent(p); } NodeElem getParentNodeElem() { return (NodeElem) getParent(); } } Node ---- package net.sf.hibernate.examples; import java.util.ArrayList; import java.util.List; /** * @author garym */ public class Node extends NodeElem { List nodeElems; Node() {}; void setParentRoot( Root p ) { setParent(p); } Root getParentRoot() { Model p = getParent(); if( p instanceof Root ) return (Root) p; return null; } NodeElem getParentNodeElem() { Model p = getParent(); if( p instanceof NodeElem ) return (NodeElem) p; return null; } List getNodeElem() { return nodeElems; } void setNodeElem( List nodeElems ) { this.nodeElems = nodeElems; } void addNodeElem( NodeElem c ) { if(nodeElems == null) nodeElems = new ArrayList(); nodeElems.add(c); c.setParent( this ); } // public String toString() { // return nodeElems == null ? super.toString() + "[]" : super.toString() + nodeElems.toString(); // } } Leaf ---- package net.sf.hibernate.examples; /** * @author garym * Child */ public class Leaf extends NodeElem { String name; Leaf() {} Leaf( String name ) { setName(name); } void setName( String name ) { this.name = name; } String getName() { return name; } public String toString() { return "name:'" + name + "'"; } } --------------------------------------------------------------------- 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-12-09 14:52:17
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-533 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-533 Summary: Bidirectional Parent / Child relationship between a class and a joined-subclass gets deleted by saveOrUpdate Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Gary Miller Created: Tue, 9 Dec 2003 8:50 AM Updated: Tue, 9 Dec 2003 8:50 AM Environment: JDK 1.4.0-b92 postgres 7.3.4 Description: The child to parent reference get set to null when an existing graph is retrieved from the DB and then saveOrUpdate is called with no changes made to the graph. The following example illustrates the point. There is a work around which is to effectively disable the setParent method if the parent provided is null. This section of code is commented out in the example. I have run this code up in a debugger but don't know how to debug a cglib generated class. I new to hibernate, please let me know how I could have improved my post. Regards Gary Miller Class hierarchy Model | --------- | | Root NodeElem | ----------- | | Node Leaf Object Graph root -> nodes node -> nodeelems All these relationships are bidirectional Therefore a node's parent can either be a Root or a NodeElem. Mapping File test.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="net.sf.hibernate.examples.Root" table="eg_root" dynamic-update="false" dynamic-insert="false"> <id name="id" column="id" type="java.lang.String" unsaved-value="null"> <generator class="uuid.hex"/> </id> <version name="version" type="int" column="version"/> <bag name="nodes" lazy="false" inverse="true" cascade="save-update"> <key column="root_id"/> <one-to-many class="net.sf.hibernate.examples.Node"/> </bag> </class> <class name="net.sf.hibernate.examples.NodeElem" table="eg_nodeelem" dynamic-update="false" dynamic-insert="false"> <id name="id" column="id" type="java.lang.String" unsaved-value="null"> <generator class="uuid.hex"/> </id> <version name="version" type="int" column="version"/> <many-to-one name="parentNodeElem" column="node_id" not-null="false" cascade="save-update"/> <joined-subclass name="net.sf.hibernate.examples.Node" table="eg_node" dynamic-update="false" dynamic-insert="false"> <key column="id"/> <many-to-one name="parentRoot" column="root_id" not-null="false" cascade="save-update"/> <bag name="nodeElem" table="NodeElem" lazy="false" inverse="true" cascade="save-update"> <key column="node_id"/> <one-to-many class="net.sf.hibernate.examples.NodeElem"/> </bag> </joined-subclass> <joined-subclass name="net.sf.hibernate.examples.Leaf" table="eg_leaf" dynamic-update="false" dynamic-insert="false"> <key column="id"/> <property name="name" type="java.lang.String" update="true" insert="true" column="name"/> </joined-subclass> </class> </hibernate-mapping> Test Classes sf.net.hibernate.example.Main ----------------------------- package net.sf.hibernate.examples; import java.util.Iterator; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.Transaction; import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.cfg.Environment; /** * @author garym * Main */ public class Main { static void print( Root r ) { System.out.println( r ); for( Iterator it = r.getNodes().iterator() ; it.hasNext() ; ) { Node n = (Node) it.next(); recurseNode( n , "\t" ); } } static void recurseNode( Node n , String pretty ) { System.out.println( pretty + n.toString() + "\t parent:" + n.getParent() ); for( Iterator it2 = n.getNodeElem().iterator(); it2.hasNext() ; ) { NodeElem ne = (NodeElem) it2.next(); if( ne instanceof Node ) recurseNode( (Node) ne , pretty + "\t" ); else System.out.println( pretty + "\t" + ne.toString() + "\t parent:" + ne.getParent() ); } } public static void main(String[] args) throws Exception { SessionFactory sessionFactory = new Configuration() .configure( "/net/sf/hibernate/examples/hibernate.cfg.xml" ) // .setProperty(Environment.HBM2DDL_AUTO, "create") .buildSessionFactory(); // for( int i = 0 ; i < 1 ; i++ ) { Session session = sessionFactory.openSession(); // Root r = null; Query query = session.createQuery("select r from Root as r"); Iterator it = query.iterate(); if( it.hasNext() ) { r = (Root) it.next(); System.out.println("Retrieved" ); Iterator it2 = r.getNodes().iterator(); if( it2.hasNext() ) { Node n = (Node) it2.next(); Node n2 = new Node(); n2.addNodeElem( new Leaf("new") ); n.addNodeElem( n2 ); } print(r); } else { System.out.println("No Root found" ); r = new Root(); Node n = new Node(); n.addNodeElem( new Leaf("Moe") ); n.addNodeElem( new Leaf("Curly") ); n.addNodeElem( new Leaf("Larry") ); r.addNode( n ); print( r ); } Transaction xaction= session.beginTransaction(); System.out.println("Started Trans" ); session.saveOrUpdate(r); System.out.println("Saved" ); xaction.commit(); System.out.println("Committed" ); session.close(); } sessionFactory.close(); } } Model ----- package net.sf.hibernate.examples; /** * @author garym * Model */ public class Model { String id; int ver; Model parent; void setParent( Model p ) { // THIS IS THE WORK AROUND // if( p == null ) { ////// parent = null; // return; // } if( parent != null && !p.equals(parent) ) throw new RuntimeException("Parent can only be set twice \nthis:'"+this+"'\nparent:'" + p + "'"); parent = p; } Model getParent( ) { return parent; } void setVersion( int v ) { ver = v; } int getVersion() { return ver; } void setId( String id ) { this.id = id; } String getId() { return id; } } Root ---- package net.sf.hibernate.examples; import java.util.ArrayList; import java.util.List; /** * @author garym * Root */ public class Root extends Model { List nodes; Root() {}; List getNodes() { return nodes; } void setNodes( List nodes ) { this.nodes = nodes; } void addNode( Node c ) { if(nodes == null) nodes = new ArrayList(); nodes.add(c); c.setParent( this ); } // public String toString() { // return nodes == null ? "[]" : nodes.toString(); // } } NodeElem -------- package net.sf.hibernate.examples; /** * @author garym */ public class NodeElem extends Model { void setParentNodeElem( NodeElem p ) { setParent(p); } NodeElem getParentNodeElem() { return (NodeElem) getParent(); } } Node ---- package net.sf.hibernate.examples; import java.util.ArrayList; import java.util.List; /** * @author garym */ public class Node extends NodeElem { List nodeElems; Node() {}; void setParentRoot( Root p ) { setParent(p); } Root getParentRoot() { Model p = getParent(); if( p instanceof Root ) return (Root) p; return null; } NodeElem getParentNodeElem() { Model p = getParent(); if( p instanceof NodeElem ) return (NodeElem) p; return null; } List getNodeElem() { return nodeElems; } void setNodeElem( List nodeElems ) { this.nodeElems = nodeElems; } void addNodeElem( NodeElem c ) { if(nodeElems == null) nodeElems = new ArrayList(); nodeElems.add(c); c.setParent( this ); } // public String toString() { // return nodeElems == null ? super.toString() + "[]" : super.toString() + nodeElems.toString(); // } } Leaf ---- package net.sf.hibernate.examples; /** * @author garym * Child */ public class Leaf extends NodeElem { String name; Leaf() {} Leaf( String name ) { setName(name); } void setName( String name ) { this.name = name; } String getName() { return name; } public String toString() { return "name:'" + name + "'"; } } --------------------------------------------------------------------- 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-12-09 00:59:41
|
The following comment has been added to this issue: Author: Andrew J Delpha Created: Mon, 8 Dec 2003 6:59 PM Body: What situations would you want to ignore a problem with an update? Are there just some database drivers that throw exceptions that are harmless? (Only really worked with Oracle since I've been using Hibernate) The type of situation I'm looking at is automated releases into a production environment, where one of the first steps is to update the database schema. If the update fails I would not want to continue the release process and would prefer not to have to parse the stdout for error messages. Would it be acceptable to add a failOnError boolean (default to false) to the execute method (and to it's corresponding ant task). I'm willing to write the patch for this, as I'll probably end up writing something to do this anyway. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-532 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-532 Summary: SchemaUpdate fails to throw exception when updates fail Type: Bug Status: Closed Priority: Minor Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.3 Assignee: Reporter: Andrew J Delpha Created: Mon, 8 Dec 2003 5:26 PM Updated: Mon, 8 Dec 2003 6:59 PM Environment: RedHat Linux 9.1, Oracle 9i, Hibernate 2.0.3, Sun Jdk1.4.1_04 Description: When running the schema update tool, it will fail to throw an exception if a SQLException is thrown when doing an update. It catches and logs the exception, but doesn't throw one. In particular, in the Hibernate 2.0.3 source code, this in on line 121 of net.sf.hibernate.tool.hbm2ddl.SchemaUpdate in the execute method, in the catch inside the for loop. I believe it should also throw a hibernate exception there. Just downloaded and looked at the 20031208 snapshot - it appears that the SchemaUpdate tool there also only logs the exceptions. Is this intentional? I believe it is desirable to have the SchemaUpdate fail if there's a problem for scripting automated builds and such. --------------------------------------------------------------------- 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-12-08 23:31:41
|
Message: The following issue has been closed. Resolver: Gavin King Date: Mon, 8 Dec 2003 5:30 PM This would not be desirable. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-532 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-532 Summary: SchemaUpdate fails to throw exception when updates fail Type: Bug Status: Closed Priority: Minor Resolution: REJECTED Project: Hibernate2 Components: toolset Versions: 2.0.3 Assignee: Reporter: Andrew J Delpha Created: Mon, 8 Dec 2003 5:26 PM Updated: Mon, 8 Dec 2003 5:30 PM Environment: RedHat Linux 9.1, Oracle 9i, Hibernate 2.0.3, Sun Jdk1.4.1_04 Description: When running the schema update tool, it will fail to throw an exception if a SQLException is thrown when doing an update. It catches and logs the exception, but doesn't throw one. In particular, in the Hibernate 2.0.3 source code, this in on line 121 of net.sf.hibernate.tool.hbm2ddl.SchemaUpdate in the execute method, in the catch inside the for loop. I believe it should also throw a hibernate exception there. Just downloaded and looked at the 20031208 snapshot - it appears that the SchemaUpdate tool there also only logs the exceptions. Is this intentional? I believe it is desirable to have the SchemaUpdate fail if there's a problem for scripting automated builds and such. --------------------------------------------------------------------- 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-12-08 23:26:41
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-532 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-532 Summary: SchemaUpdate fails to throw exception when updates fail Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: toolset Versions: 2.0.3 Assignee: Reporter: Andrew J Delpha Created: Mon, 8 Dec 2003 5:26 PM Updated: Mon, 8 Dec 2003 5:26 PM Environment: RedHat Linux 9.1, Oracle 9i, Hibernate 2.0.3, Sun Jdk1.4.1_04 Description: When running the schema update tool, it will fail to throw an exception if a SQLException is thrown when doing an update. It catches and logs the exception, but doesn't throw one. In particular, in the Hibernate 2.0.3 source code, this in on line 121 of net.sf.hibernate.tool.hbm2ddl.SchemaUpdate in the execute method, in the catch inside the for loop. I believe it should also throw a hibernate exception there. Just downloaded and looked at the 20031208 snapshot - it appears that the SchemaUpdate tool there also only logs the exceptions. Is this intentional? I believe it is desirable to have the SchemaUpdate fail if there's a problem for scripting automated builds and such. --------------------------------------------------------------------- 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-12-08 23:14:41
|
Message: The following issue has been closed. Resolver: Gavin King Date: Mon, 8 Dec 2003 5:14 PM Thanks, I added this implementation to Oracle9Dialect --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-317 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-317 Summary: attempt to recreate sequence on schema update Type: Improvement Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Fix Fors: 2.1 final Versions: 2.1 beta 3 Assignee: Reporter: Zeehond Created: Mon, 8 Sep 2003 3:23 PM Updated: Mon, 8 Dec 2003 5:14 PM Environment: jboss 3.2.2, oracle 9i, sun jdk 1.4.2 Description: this is my code I run in application init routine: ds = new Configuration(); ds.configure(this.getClass().getClassLoader().getResource("hibernate.cfg.xml")); SchemaUpdate su = new SchemaUpdate(ds); su.execute(false); all tables are updated OK, but the following error happens: 2003-09-08 22:13:00,000 ERROR [net.sf.hibernate.tool.hbm2ddl.SchemaUpdate] Unsuccessful: create sequence hibernate_sequence java.sql.SQLException: ORA-00955: name is already used by an existing object at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321) at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1741) at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1902) at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047) at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709) at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796) at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:233) at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:120) seems like Hibernate can't define whether the sequence already exists --------------------------------------------------------------------- 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-12-08 23:04:41
|
The following comment has been added to this issue: Author: Andrew J Delpha Created: Mon, 8 Dec 2003 5:03 PM Body: This is because by default, the OracleDialect and Oracle9iDialect do not provide a method for hibernate to discover what sequences exist. I extended the OracleDialect class and provided an implementation of public String getQuerySequencesString(). I believe that the user_sequences view is always available in oracle, but I don't know that for certain your mileage may vary. For reference here's what mine looks like public class MyOracleDialect extends OracleDialect { public MyOracleDialect() { super(); } public String getQuerySequencesString() { return "select SEQUENCE_NAME from user_sequences"; } } --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-317 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-317 Summary: attempt to recreate sequence on schema update Type: Improvement Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 3 Assignee: Reporter: Zeehond Created: Mon, 8 Sep 2003 3:23 PM Updated: Mon, 8 Dec 2003 5:03 PM Environment: jboss 3.2.2, oracle 9i, sun jdk 1.4.2 Description: this is my code I run in application init routine: ds = new Configuration(); ds.configure(this.getClass().getClassLoader().getResource("hibernate.cfg.xml")); SchemaUpdate su = new SchemaUpdate(ds); su.execute(false); all tables are updated OK, but the following error happens: 2003-09-08 22:13:00,000 ERROR [net.sf.hibernate.tool.hbm2ddl.SchemaUpdate] Unsuccessful: create sequence hibernate_sequence java.sql.SQLException: ORA-00955: name is already used by an existing object at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321) at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1741) at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1902) at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047) at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709) at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796) at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:233) at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:120) seems like Hibernate can't define whether the sequence already exists --------------------------------------------------------------------- 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-12-08 12:28:41
|
The following comment has been added to this issue: Author: Hunter Kelly Created: Mon, 8 Dec 2003 6:28 AM Body: No, I stand corrected, it was working, but the type had been uuid's. There was some strangeness though, that forced me to change from uuid to int, and then things started blowing up... Anyway, I guess I've got enough for now. If you want me to draft up some kind of FAQ and an answer (you'll have to fill in the technical details), I'd be happy to. I do think it needs to be better documented, at least... --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-531 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-531 Summary: One-To-One mappings with int/native ids don't work properly Type: Bug Status: Closed Priority: Critical Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 final 2.1 rc1 Assignee: Reporter: Hunter Kelly Created: Mon, 8 Dec 2003 4:49 AM Updated: Mon, 8 Dec 2003 6:28 AM Environment: RedHat Linux 9.0 MySQL 4.0.14-standard Latest Hibernate CVS tree Description: I have a one to one mapping in a class, Thing, that maps to IntThing and UUIDThing. IntThing and UUIDThing both define a many-to-one mapping back to Thing. Int thing uses "native" generator for id. UUID uses "uuid.hex" generator for id. I would have thought they'd behave the same, but they don't. I've built a truth table for each, where I changed the values of the "constrained" attribute on the one-to-one mapping and the "not-null" attribute on the many-to-one mapping. For UUID thing: Constrained = true | Constrained = false ------------------------------------------------------- Not-Null | | true | failed | sucess ------------------------------------------------------- Not-Null | false | success | success ------------------------------------------------------- For Int thing: Constrained = true | Constrained = false ------------------------------------------------------- Not-Null| | true | failed | failed ------------------------------------------------------- Not-Null| | false | success | failed ------------------------------------------------------- The above chart shows that regardless of what constrained is set to, you can't have a one-to-one mapping to an entity with an int id type that has a not-null constraint back to the parent. I'll attach the files now - to compile and run I just made a copy of the "eg" target in Hibernate's build.xml, uncommented the lines in hibernate.properties relevant to MySQL and changed the database name. --------------------------------------------------------------------- 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 |