-->
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.  [ 5 posts ] 
Author Message
 Post subject: Cascade metadata
PostPosted: Fri Apr 23, 2004 2:34 pm 
Beginner
Beginner

Joined: Wed Feb 25, 2004 6:23 pm
Posts: 39
Am I just missing it somewhere, or is there no way to get cascade information from the metadata API?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 6:20 pm 
Beginner
Beginner

Joined: Wed Feb 25, 2004 6:23 pm
Posts: 39
I believe I found the cascade information... though it isn't directly accessible from metadata (which seems odd). Basically, this is how I do it:
Code:
Cascades.CascadeStyle[] propertyCascades = null;
if(session instanceof SessionImplementor) {
  SessionImplementor si = (SessionImplementor)session;
  ClassPersister cp = si.getPersister(dataClass);
  propertyCascades = cp.getPropertyCascadeStyles();
}

It "smells" a little hacky to me... and I haven't tried it yet, but from the docs it looks like this should work.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 24, 2004 3:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you probably should try to get it from the Configuration object instead

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 5:41 pm 
Beginner
Beginner

Joined: Wed Feb 25, 2004 6:23 pm
Posts: 39
The problem there is that my code has no access to the Configuration used to create the SessionFactory. All it has is a Session.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 5:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well, store the Configuration somewhere in a Singleton for example.


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

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.