[Hibernate] Mapping a many-to-many relationships with addition attributes.
I am trying to correctly map the following scenario: - A Paper can have many Authors. - An Author can have many Papers. - Every Author appears in the list of a Paper's authors in a given position. - Positions are integer values, not necessarily consecutively ordered starting at 0 (this rules out using a , I think). I am using Hibernate 1.2.3. Following the advice given at page 37 of the reference doc, I mapped my entities as follows: ... This works fine as long as creating papers and associating authors to them is concerned. But now I have a new requirement: I must be able to delete an author. Of course, if I just do a session.delete(theAuthor) and theAuthor has some papers in his name, the operation fails with a referential integrity violation error, trying to delete a row from the AUTHOR table that is referred to by one or more rows in the AUTHORSHIP table. I didn't want to manually find and delete the dependent rows, so I thought about declaring the relationship between Authors and Papers in the Author.hbm.xml file, like the following: ... This seemed to work fine. Deleting an author automatically caused all the relevant Authorship rows to be deleted as well. However, this caused some problems in the code where I add authors to papers. Sometimes, but not always, I get an exception after calling Paper.setAuthors(), stating that a paper with the given ID was already loaded in the current session. I think this is due to the fact that Hibernate follows the relationship from Paper to Author and back, trying to fetch twice the same paper. If I don't declare the many-to-one relationship from Authors to Papers, everything is fine, were it not for the fact that I have to manually delete all the Authorships before deleting an Author (and I don't even know HOW!). So, I'm asking if there's anyone who's ever found himself in the same situation, and what is the recommended way to implement this kind of relationship. Thanks in Advance, Ugo -- Ugo Cei - Consorzio di Bioingegneria e Informatica Medica P.le Volontari del Sangue, 2 - 27100 Pavia - Italy Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED] --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] huge tring storage
What I found that worked was leaving the type as "string" in the hbm.xml file and then just going into the table directly and changing the column to "text" type. I'll try this out and let you know how it works.. it would be nice if there was a way to specify a more specific database type in the configuration file though. Thanks! - Original Message - From: <[EMAIL PROTECTED]> To: "Justen Stepka" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 1:26 AM Subject: Re: [Hibernate] huge tring storage > > Try using the Hibernate "clob" type. > > You can use Hibernate.createClob() to instantiate a new "fake" Clob. > > Note that JDBC driver support for Clobs is patchy and inconsistent and I do > not guarantee that the Clob support will work on all platforms. > > > > > > > > "Justen Stepka" > <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> > Sent by:cc: > [EMAIL PROTECTED] Subject: [Hibernate] huge tring storage > eforge.net > > > 13/02/03 03:39 AM > > > > > > > Regard, > > I am looking to store a String to the database that would be a legal > contract so the amount of space necessary would be rather large in the > database. > > What type of mapping declaration do I want for my tag? I > have tried serializable and object but both are just not enough... I was > hoping there might be some type for 'text' but that turned up dead ends. > > Thanks! > > Justen Stepka > > > > ** > Any personal or sensitive information contained in this email and > attachments must be handled in accordance with the Victorian Information > Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 > (Commonwealth), as applicable. > > This email, including all attachments, is confidential. If you are not the > intended recipient, you must not disclose, distribute, copy or use the > information contained in this email or attachments. Any confidentiality or > privilege is not waived or lost because this email has been sent to you in > error. If you have received it in error, please let us know by reply > email, delete it from your system and destroy any copies. > ** > > > > --- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] [ hibernate-Feature Requests-682592 ] Have hbm2java generate support for veto and change listeners
Feature Requests item #682592, was opened at 2003-02-07 23:19 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428711&aid=682592&group_id=40712 Category: codegen Group: None Status: Open Priority: 5 Submitted By: Max R. Andersen (maxcsaucdk) Assigned to: Max R. Andersen (maxcsaucdk) Summary: Have hbm2java generate support for veto and change listeners Initial Comment: How about adding somemore JavaBeans Functionality, namely the PropertyChange- and VetoableChangeMechanism. I envision something like which would lead to the incorporation of the appropriate SupportClass and the Eventfiring code to the setter Methods. Specifically I am refering to 1) the hibernate codegenerator 2) JavaBeans Spec. 1.0.1 Sect. 7.4 Thus the SupportClass is given by the appropriate classes in the beans package; the code should look somewhat like this: import java.awt.*; import java.beans.*; public class JellyBean { public Color getColor() { return ourColor; } public void setColor(Color newColor) { Color oldColor = ourColor; ourColor = newColor; changes.firePropertyChange( color , oldColor, newColor); } public int getPriceInCents() { return ourPriceInCents; } public void setPriceInCents(int newPriceInCents) throws PropertyVetoException { int oldPriceInCents = ourPriceInCents; // First tell the vetoers about the change. If anyone objects, we // let the PropertyVetoException propagate back to our caller. vetos.fireVetoableChange( priceInCents , new Integer(oldPriceInCents), new Integer(newPriceInCents)); // No one vetoed, so go ahead and make the change. ourPriceInCents = newPriceInCents; changes.firePropertyChange( priceInCents , new Integer(oldPriceInCents), new Integer(newPriceInCents)); } public void addPropertyChangeListener(PropertyChangeListener l) { changes.addPropertyChangeListener(l); } public void removePropertyChangeListener(PropertyChangeListener l) { changes.removePropertyChangeListener(l); } public void addVetoableChangeListener(VetoableChangeListener l) { vetos.addVetoableChangeListener(l); } public void removeVetoableChangeListener(VetoableChangeListener l) { vetos.removeVetoableChangeListener(l); } private PropertyChangeSupport changes = new PropertyChangeSupport(this); private VetoableChangeSupport vetos = new VetoableChangeSupport(this); private Color ourColor = Color.orange; private int ourPriceInCents = 2; } See https://sourceforge.net/forum/forum.php?thread_id=8097 53&forum_id=128638 for the glory details :) -- Comment By: Klaus Zimmermann (zklaus) Date: 2003-02-12 19:06 Message: Logged In: YES user_id=171184 Since Gavin said I should repost the patch because patches on the mailing list are likely to get lost I posted it to patches where it received tracker id 685440 -- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-02-10 23:37 Message: Logged In: YES user_id=18119 There should be something like: Check to Upload and Attach a File:[] (?) [] [Choose] File Description: [_] Where you should be able to Choose the file. Remember to set a mark in the "Check to upload and attach a file" checkbox. If you can't find it then an alternative is to post it as an attachment to the devel mailing list. -- Comment By: Klaus Zimmermann (zklaus) Date: 2003-02-10 23:31 Message: Logged In: YES user_id=171184 is it possible that I lack rights? cause I don't see no attach button. Only submit comment. -- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-02-10 23:26 Message: Logged In: YES user_id=18119 Just attach a file to this RFE. Its done at the bottom of the page. -- Comment By: Klaus Zimmermann (zklaus) Date: 2003-02-10 23:21 Message: Logged In: YES user_id=171184 I'm done. How shall I submit the Patch? -- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-02-08 13:39 Message: Logged In: YES user_id=18119 It should be done in Hibernate2. is only in Hibernate2. -- Comment By: Klaus Zimmermann (zklaus) Date: 2003-02-08 13:11 Message: Logged In: YES user_id=171184 thanks. I'll give it a try. One more question: Should such development take place in hibernate2 or is there still active development in hibernate(1)? -- Comment By: Max R. Andersen (maxcsaucdk) Date: 2003-02-08
Re: [Hibernate] huge tring storage
Try using the Hibernate "clob" type. You can use Hibernate.createClob() to instantiate a new "fake" Clob. Note that JDBC driver support for Clobs is patchy and inconsistent and I do not guarantee that the Clob support will work on all platforms. "Justen Stepka" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] huge tring storage eforge.net 13/02/03 03:39 AM Regard, I am looking to store a String to the database that would be a legal contract so the amount of space necessary would be rather large in the database. What type of mapping declaration do I want for my tag? I have tried serializable and object but both are just not enough... I was hoping there might be some type for 'text' but that turned up dead ends. Thanks! Justen Stepka ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] How to do this (assiciation)?
Nup, it's not allowed currently. It would probably be pretty trivial to support in the same way we support the order-by attribute ... simply have a where attribute of a collection mapping. If you want to try implementing that, please feel welcome since many people have asked for this. Currently each collection requires its own foreign key column. I am not so keen on this kind of model, actually. "Aapo Laakkonen" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> Sent by:cc: [EMAIL PROTECTED] Subject: [Hibernate] How to do this (assiciation)? eforge.net 13/02/03 02:16 AM Please respond to aapo.laakkonen Let's say I have a Message table: message (id, subject, content, toaddr, ccaddr) - id = long identifier - subject = text string - content = text string - toaddr = mapping to a address table with address.type='t'. - ccaddr = mapping to a address table with address.type='c'. Or it can be an integer or anything else... maybe an enumeration. And I have a table Address: address (id, message_id, email, type) - id = long identifier - message_id = long foreign key relation to message table - email = text string - type = type that identifies the type of this address field (to-address or cc-address). I'd like to to mapping so that my Message class looks something like this: public class AddressBean implements Serializable { private long id; private String subject; private String Content; private Set toaddr; private Set ccaddr; } - Each message has zero to many to-addresses. - Each message has zero to many cc-addresses. - Each address belongs to exactly one message. How do I write a mapping for that? Hibernate needs to somehow know that we are mapping toaddr set to address table that has a particular address.message_id and address.type. Kind Regards Aapo Laakkonen --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ** --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] [ hibernate-Patches-684379 ] JMX config
Patches item #684379, was opened at 2003-02-11 15:30 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=684379&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jiri Luzny (tepich) Assigned to: Nobody/Anonymous (nobody) Summary: JMX config Initial Comment: A small extension in HibernateServiceMBean so you can now specify a dynamic set of additional properties in hibernate-service.xml. e.g.: jboss.jca:service=RARDeployer java:/HibernateFactory ... ... -- >Comment By: Gavin King (oneovthafew) Date: 2003-02-13 18:36 Message: Logged In: YES user_id=384580 Thanks, I will address this as soon as I can... -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=684379&group_id=40712 --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] CodeGenerator Tool
> The CodeGenerator tool generates private setters/getters. > Is there a way to force it to generate public setters/ > getters? Grap the latest cvs version or modify BasicRenderer. --- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] [ hibernate-Patches-682992 ] optimization
Patches item #682992, was opened at 2003-02-09 04:53 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=682992&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Juozas Baliuka (baliuka) Assigned to: Nobody/Anonymous (nobody) Summary: optimization Initial Comment: eleminates reflection to read/write properties and newInstance (if possible), persister disables optimizations on error in cglib. -- >Comment By: Gavin King (oneovthafew) Date: 2003-02-13 18:37 Message: Logged In: YES user_id=384580 No, I don't think it keeps a reference to the Iterator. Both the Iterator and the SessionImpl keep a reference to an open ResultSet. -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-13 05:16 Message: Logged In: YES user_id=337001 forgot to add file for ComponentType -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-13 00:08 Message: Logged In: YES user_id=337001 Hibernate holds strong reference on iterator returned by s.iterate( query ), is't it ? -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-12 07:30 Message: Logged In: YES user_id=337001 I have tested situation like this ( iteration ) String query1= "from fo in class FoPrivate" ; String query2= "from fo in class FoPublic" ; java.util.Iterator i = s.iterate( query ); long time = System.currentTimeMillis(); while(i.hasNext()) i.next(); System.out.println( (System.currentTimeMillis() - time) ); It shows 3%- 5% Performance incremet with optimizer, but I do not trust this kind of test very mutch. I know generated code it is faster, but can't say any numbers, It is not trivial to test. BTW: It is a problem in situation like this: for(int i=0 i< 1000; i++ ) s.iterate( query ).next(); java.lang.OutOfMemoryError with -Xmx256M -- Comment By: Gavin King (oneovthafew) Date: 2003-02-11 22:33 Message: Logged In: YES user_id=384580 Cool. This looks very nice. Have you tried to run any performance tests to see if there is an observable difference in performance? -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-09 19:08 Message: Logged In: YES user_id=337001 crappy UI -- Comment By: Gavin King (oneovthafew) Date: 2003-02-09 11:11 Message: Logged In: YES user_id=384580 Theres no attached file. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=682992&group_id=40712 --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] [ hibernate-Patches-685440 ] RFE-682592-hbm2java generate Beans style property events
Patches item #685440, was opened at 2003-02-12 19:02 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=685440&group_id=40712 Category: Codegen Group: None Status: Open Resolution: None Priority: 5 Submitted By: Klaus Zimmermann (zklaus) Assigned to: Nobody/Anonymous (nobody) Summary: RFE-682592-hbm2java generate Beans style property events Initial Comment: This patch implements the generation of bound and constraint properties as recommended in the JavaBeans Spec. 1.0.1 Sect. 7.4. It makes use of the meta-tag with attribute beans-property-type. Recognised values are bound and constraint, case-insensitive. Example: constraint Additionally it fixes what I consider to be a misplaced brace in net.sf.hibernate.tool.hbm2java.ClassName which leads to name remaining null if the described type is a primitive. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=685440&group_id=40712 --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] [ hibernate-Patches-682992 ] optimization
Patches item #682992, was opened at 2003-02-08 17:53 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=682992&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Juozas Baliuka (baliuka) Assigned to: Nobody/Anonymous (nobody) Summary: optimization Initial Comment: eleminates reflection to read/write properties and newInstance (if possible), persister disables optimizations on error in cglib. -- >Comment By: Juozas Baliuka (baliuka) Date: 2003-02-12 18:16 Message: Logged In: YES user_id=337001 forgot to add file for ComponentType -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-12 13:08 Message: Logged In: YES user_id=337001 Hibernate holds strong reference on iterator returned by s.iterate( query ), is't it ? -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-11 20:30 Message: Logged In: YES user_id=337001 I have tested situation like this ( iteration ) String query1= "from fo in class FoPrivate" ; String query2= "from fo in class FoPublic" ; java.util.Iterator i = s.iterate( query ); long time = System.currentTimeMillis(); while(i.hasNext()) i.next(); System.out.println( (System.currentTimeMillis() - time) ); It shows 3%- 5% Performance incremet with optimizer, but I do not trust this kind of test very mutch. I know generated code it is faster, but can't say any numbers, It is not trivial to test. BTW: It is a problem in situation like this: for(int i=0 i< 1000; i++ ) s.iterate( query ).next(); java.lang.OutOfMemoryError with -Xmx256M -- Comment By: Gavin King (oneovthafew) Date: 2003-02-11 11:33 Message: Logged In: YES user_id=384580 Cool. This looks very nice. Have you tried to run any performance tests to see if there is an observable difference in performance? -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-09 08:08 Message: Logged In: YES user_id=337001 crappy UI -- Comment By: Gavin King (oneovthafew) Date: 2003-02-09 00:11 Message: Logged In: YES user_id=384580 Theres no attached file. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=682992&group_id=40712 --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
R: R: [Hibernate] [ hibernate-Bugs-684496 ] Nested multiple columns composite-id causes "broken mapping"
Done. http://sourceforge.net/tracker/index.php?func=detail&aid=685907&group_id=40712&atid=428710 stefano -Messaggio originale- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Inviato: giovedì 13 febbraio 2003 8.28 A: Travelli Stefano Cc: [EMAIL PROTECTED] Oggetto: Re: R: [Hibernate] [ hibernate-Bugs-684496 ] Nested multiple columns composite-id causes "broken mapping" Cool! Am I to understand that this is now a working patch? Can you submit the fix via the patch manager? Thanks for this :) --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
R: [Hibernate] huge tring storage
Try sql-type attribute in tag: stefano -Messaggio originale- Da: Justen Stepka [mailto:[EMAIL PROTECTED] Inviato: giovedì 13 febbraio 2003 20.14 A: Justen Stepka; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Oggetto: Re: [Hibernate] huge tring storage What I found that worked was leaving the type as "string" in the hbm.xml file and then just going into the table directly and changing the column to "text" type. I'll try this out and let you know how it works.. it would be nice if there was a way to specify a more specific database type in the configuration file though. Thanks! - Original Message - From: <[EMAIL PROTECTED]> To: "Justen Stepka" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 1:26 AM Subject: Re: [Hibernate] huge tring storage > > Try using the Hibernate "clob" type. > > You can use Hibernate.createClob() to instantiate a new "fake" Clob. > > Note that JDBC driver support for Clobs is patchy and inconsistent and I do > not guarantee that the Clob support will work on all platforms. > > > > > > > > "Justen Stepka" > <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]> > Sent by:cc: > [EMAIL PROTECTED] Subject: [Hibernate] huge tring storage > eforge.net > > > 13/02/03 03:39 AM > > > > > > > Regard, > > I am looking to store a String to the database that would be a legal > contract so the amount of space necessary would be rather large in the > database. > > What type of mapping declaration do I want for my tag? I > have tried serializable and object but both are just not enough... I was > hoping there might be some type for 'text' but that turned up dead ends. > > Thanks! > > Justen Stepka > > > > ** > Any personal or sensitive information contained in this email and > attachments must be handled in accordance with the Victorian Information > Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 > (Commonwealth), as applicable. > > This email, including all attachments, is confidential. If you are not the > intended recipient, you must not disclose, distribute, copy or use the > information contained in this email or attachments. Any confidentiality or > privilege is not waived or lost because this email has been sent to you in > error. If you have received it in error, please let us know by reply > email, delete it from your system and destroy any copies. > ** > > > > --- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] [ hibernate-Patches-682992 ] optimization
Patches item #682992, was opened at 2003-02-08 17:53 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=682992&group_id=40712 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Juozas Baliuka (baliuka) Assigned to: Nobody/Anonymous (nobody) Summary: optimization Initial Comment: eleminates reflection to read/write properties and newInstance (if possible), persister disables optimizations on error in cglib. -- >Comment By: Juozas Baliuka (baliuka) Date: 2003-02-12 13:08 Message: Logged In: YES user_id=337001 Hibernate holds strong reference on iterator returned by s.iterate( query ), is't it ? -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-11 20:30 Message: Logged In: YES user_id=337001 I have tested situation like this ( iteration ) String query1= "from fo in class FoPrivate" ; String query2= "from fo in class FoPublic" ; java.util.Iterator i = s.iterate( query ); long time = System.currentTimeMillis(); while(i.hasNext()) i.next(); System.out.println( (System.currentTimeMillis() - time) ); It shows 3%- 5% Performance incremet with optimizer, but I do not trust this kind of test very mutch. I know generated code it is faster, but can't say any numbers, It is not trivial to test. BTW: It is a problem in situation like this: for(int i=0 i< 1000; i++ ) s.iterate( query ).next(); java.lang.OutOfMemoryError with -Xmx256M -- Comment By: Gavin King (oneovthafew) Date: 2003-02-11 11:33 Message: Logged In: YES user_id=384580 Cool. This looks very nice. Have you tried to run any performance tests to see if there is an observable difference in performance? -- Comment By: Juozas Baliuka (baliuka) Date: 2003-02-09 08:08 Message: Logged In: YES user_id=337001 crappy UI -- Comment By: Gavin King (oneovthafew) Date: 2003-02-09 00:11 Message: Logged In: YES user_id=384580 Theres no attached file. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=428710&aid=682992&group_id=40712 --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] CodeGenerator Tool
The CodeGenerator tool generates private setters/getters. Is there a way to force it to generate public setters/getters? Gordon --- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] How to do this (assiciation)?
Can I implement this as this? Leave Address as a interface. Class ToAddress--- mapped to address with type='t' class CCAddress---mapped to Address with type='c' Then in Class has two sets toaddr mapped to a list of ToAddress ccaddrmapped to a list of CCAddress Althought I did not try, but it should work. jason --- [EMAIL PROTECTED] wrote: > > Nup, it's not allowed currently. It would probably > be pretty trivial to > support in the same way we support the order-by > attribute ... simply have a > where attribute of a collection mapping. If you want > to try implementing > that, please feel welcome since many people have > asked for this. Currently > each collection requires its own foreign key column. > > I am not so keen on this kind of model, actually. > > > > > > > "Aapo Laakkonen" > > > <[EMAIL PROTECTED]> >To: > <[EMAIL PROTECTED]> > > Sent by: >cc: > > > [EMAIL PROTECTED] Subject: > [Hibernate] How to do this (assiciation)? > > eforge.net > > > > > > > > > 13/02/03 02:16 AM > > > Please respond to aapo.laakkonen > > > > > > > > > > > > > Let's say I have a Message table: > message (id, subject, content, toaddr, ccaddr) > > - id = long identifier > - subject = text string > - content = text string > - toaddr = mapping to a address table with > address.type='t'. > - ccaddr = mapping to a address table with > address.type='c'. > > Or it can be an integer or anything else... maybe an > enumeration. > > And I have a table Address: > address (id, message_id, email, type) > > - id = long identifier > - message_id = long foreign key relation to message > table > - email = text string > - type = type that identifies the type of this > address field (to-address > or cc-address). > > I'd like to to mapping so that my Message class > looks something like > this: > > public class AddressBean implements Serializable { >private long id; >private String subject; >private String Content; >private Set toaddr; >private Set ccaddr; > } > > - Each message has zero to many to-addresses. > - Each message has zero to many cc-addresses. > - Each address belongs to exactly one message. > > How do I write a mapping for that? Hibernate needs > to somehow know that > we are mapping toaddr set to address table that has > a particular > address.message_id and address.type. > > > Kind Regards > Aapo Laakkonen > > > > --- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = > Something 2 See! > http://www.vasoftware.com > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > > ** > Any personal or sensitive information contained in > this email and > attachments must be handled in accordance with the > Victorian Information > Privacy Act 2000, the Health Records Act 2001 or the > Privacy Act 1988 > (Commonwealth), as applicable. > > This email, including all attachments, is > confidential. If you are not the > intended recipient, you must not disclose, > distribute, copy or use the > information contained in this email or attachments. > Any confidentiality or > privilege is not waived or lost because this email > has been sent to you in > error. If you have received it in error, please let > us know by reply > email, delete it from your system and destroy any > copies. > **