Hi,

I think you need something like:

if (!(this instanceof javax.jdo.spi.PersistenceCapable)) {
return null;
}
OIDImpl longIdentity = (OIDImpl) JDOHelper.getObjectId(this);
return longIdentity.getKeyValue();

Martin Grigorov
Funemployed! Available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Mar 11, 2015 at 5:58 PM, Lechner Andreas <alech...@at.focusmr.com>
wrote:

> Hi all,
>
> Maybe i have overseen something.
>
> I want to persist MyObject.
> It has a member ID which is a @PrimaryKey and @Persistent(valueStrategy =
> IdGeneratorStrategy.IDENTITY).
>
> When id do:
> PersistenceManager jdoPersistenceManager =
> isisJdoSupport.getJdoPersistenceManager();
> MyObject persistedObject = jdoPersistenceManager.makePersistent(myObject);
>
> I get an ID filled in the returned persistedObject.
>
> How do i get the ID of the fresh persisted MyObject when I use the
> injected DomainObjectContainer container?
> container.persistIfNotAlready(settingItem);
>
> I need the ID and want to use the implemented soloution from Apache ISIS
> and not to
> implement my own soloution.
>
> best regards
> Andreas
>

Reply via email to