Fornax-Platform
Forum

Hibernate saveOrUpdate() instead of save()

View: New views
2 Messages — Rating Filter:   Alert me  

Hibernate saveOrUpdate() instead of save()

by Jef Pfeiffer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hibernate saveOrUpdate() instead of save() Is there a straightforward way for sculptor to use a saveOrUpdate() rather than a save() via a default data access object?

I’ve got detached entities and its not particularly easy to know whether I should use a save() or merge().

Thanks if you’ve got a quick fix, otherwise I’ll just do it old fashioned way...

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Fornax-developer mailing list
Fornax-developer@...
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Re: Hibernate saveOrUpdate() instead of save()

by PaloT :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Method save care about it. When you send new object (id==null) it's
store new object. When you send detached object (id is assigned) new
values are merged to previous record.

Pavel


On Thu, Sep 17, 2009 at 8:17 PM, Jef Pfeiffer <jef_pfeiffer@...> wrote:

> Is there a straightforward way for sculptor to use a saveOrUpdate() rather
> than a save() via a default data access object?
>
> I’ve got detached entities and its not particularly easy to know whether I
> should use a save() or merge().
>
> Thanks if you’ve got a quick fix, otherwise I’ll just do it old fashioned
> way...
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@...
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Fornax-developer mailing list
Fornax-developer@...
https://lists.sourceforge.net/lists/listinfo/fornax-developer