-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to access the EntityPersister for a persistent instance?
PostPosted: Mon Jan 24, 2005 8:37 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
Hibernate version: 2.1.6

How can I access the EntityPersister for a persistent instance?

I can get the ClassMetadata for the class via SessionFactory.getClassMetaData(Class) and cast the returned value to an AbstractEntityClass, but I don't like "casting on faith".

The ultimate objective is to get a handle on the IdentifierGenerator for the instance's persistent class. For this class, I want to sometimes assign IDs manually and sometimes have Hibernate assign IDs, and I'd like to use the same underlying mechanism (Oracle sequences).

Is there another good way to define and access Identifier Generators in Hibernate? For instance, it would be nice if I could map a sequence as a stand-alone Hibernate construct, as opposed to writing the JDBC to do it myself.

Thanks!
- nate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.