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