From: Gavin K. <ga...@ap...> - 2002-11-19 13:32:04
|
Yes, I *have* thought of that, but it seems so .... model intrusive .... Not really in the spirit of the rest of our problem solutions .... Part of the reason I'm not really considering this issue a show stopper is that I really would prefer if people would use generated identifiers ;) ----- Original Message ----- From: "Doug Currie" <e...@fl...> To: "Gavin King" <ga...@ap...> Sent: Tuesday, November 19, 2002 9:49 AM Subject: Re: [hibernate - Open Discussion] RE: cascade save() problem in one-to-one rel > Gavin, > > Although I'm still not using Hibernate at my new job, I've been > lurking on the mailing lists. This question of saveOrUpdate() and > assigned identifiers seems to come up from time to time. > > Wouldn't it be possible to have a property that is not persisted, but > which flags the instance as persisted or not. It would be initially > false for transient instances, initially true for instances constructed > from the database, and set to true when the instance is saved (where > you'd normally assign the identifier). You'd only need this > additional property for classes with assigned identifiers that needed > the saveOrUpdate() capability. > > I have no need for this myself, but seeing "theres nothing we can > really do to improve it..." always gets my attention for a moment! > > Regards, > > e > > > Read and respond to this message at: > > https://sourceforge.net/forum/message.php?msg_id=1760812 > > By: oneovthafew > > > Nah, you just have to accept the fact that saveOrUpdate() can't really work > > with assigned identifiers. It will always save or always update. The same comment > > applies to the semantics of cascaded save-update. > > > This is just a limitation of using assigned identifiers and theres nothing we > > can really do to improve it... |
From: Mark W. <mor...@SM...> - 2002-11-19 19:56:02
|
Gavin King wrote: >Yes, I *have* thought of that, but it seems so .... model intrusive .... > >Not really in the spirit of the rest of our problem solutions .... > >Part of the reason I'm not really considering this issue a show stopper is >that I really would prefer if people would use generated identifiers ;) > Yeah, but in some cases (eg. mine!) this just isn't possible. I personally would love to see something like what Doug proposed implemented. I already have a couple hacks in my code to do something like this in a couple extreme situations with help from the lifecycle interface... As for it being model intrusive, I don't see a problem with being a little model intrusive to support a use-case that you do not recommend (ie. not using generated identifiers). Just got back from vacation and I can't wait to test out the new normalized table mapping functionality. Thanks, -Mark >----- Original Message ----- >From: "Doug Currie" <e...@fl...> >To: "Gavin King" <ga...@ap...> >Sent: Tuesday, November 19, 2002 9:49 AM >Subject: Re: [hibernate - Open Discussion] RE: cascade save() problem in >one-to-one rel > > > > >>Gavin, >> >>Although I'm still not using Hibernate at my new job, I've been >>lurking on the mailing lists. This question of saveOrUpdate() and >>assigned identifiers seems to come up from time to time. >> >>Wouldn't it be possible to have a property that is not persisted, but >>which flags the instance as persisted or not. It would be initially >>false for transient instances, initially true for instances constructed >>from the database, and set to true when the instance is saved (where >>you'd normally assign the identifier). You'd only need this >>additional property for classes with assigned identifiers that needed >>the saveOrUpdate() capability. >> >>I have no need for this myself, but seeing "theres nothing we can >>really do to improve it..." always gets my attention for a moment! >> >>Regards, >> >>e >> >> >> >>>Read and respond to this message at: >>>https://sourceforge.net/forum/message.php?msg_id=1760812 >>>By: oneovthafew >>> >>> >>>Nah, you just have to accept the fact that saveOrUpdate() can't really >>> >>> >work > > >>>with assigned identifiers. It will always save or always update. The >>> >>> >same comment > > >>>applies to the semantics of cascaded save-update. >>> >>> >>>This is just a limitation of using assigned identifiers and theres >>> >>> >nothing we > > >>>can really do to improve it... >>> >>> > > > >------------------------------------------------------- >This sf.net email is sponsored by: To learn the basics of securing >your web site with SSL, click here to get a FREE TRIAL of a Thawte >Server Certificate: http://www.gothawte.com/rd524.html >_______________________________________________ >hibernate-devel mailing list >hib...@li... >https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > |