-->
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.  [ 4 posts ] 
Author Message
 Post subject: Overriding @GenericGenerator parameters
PostPosted: Thu Mar 23, 2006 5:37 pm 
Beginner
Beginner

Joined: Mon May 16, 2005 6:06 am
Posts: 20
Hi,
I'm using the latest Hibernate Entity Manager + Hibernate Annotation packages and like to know if its possible to override paramters of a generator specified using the @GenericGenerator annotation.

An Example: Let's say for the following entity I want to have a different value for the max_lo parameter for the id generator depending on the environment the class is used in (e.g. making it configurable somehow)? Or Let's say I need to use completly different ID generators for different systems, how could I specify that without needing to change the annotation and recompile the class?

Code:
@Entity
public class MyEntity {
  @Id
  @GeneratedValue(generator = "oid")
  @GenericGenerator(
    name = "oid",
    strategy = "org.hibernate.id.TableHiLoGenerator",
    parameters = {@Parameter(name = "max_lo", value = "1")}
  )
  private Integer oid;

  // ... other stuff here
}


Any ideas and comments are appreciated,
Johan


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 25, 2006 9:47 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I'm working on the ability to override annotations by some XML descriptor.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 26, 2006 10:39 am 
Beginner
Beginner

Joined: Mon May 16, 2005 6:06 am
Posts: 20
Cool. Thanks for your reply.


Top
 Profile  
 
 Post subject: Thanks!!!
PostPosted: Wed Mar 05, 2008 9:28 am 
Newbie

Joined: Fri Aug 04, 2006 9:34 am
Posts: 5
I need just this, thanks for the tip.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.