Hi,
I have a bean:
class SomeBean {
private long number;
//... getter/setter
}
I need to assign a value to to SomeBean.number automatically, when it's persisted with the EntityManager.
Are there any annotations that would do the job? GeneratedValue didn't help, as much as I tried. Note that SomeBean.number is not an id. It's just a field which I need to automatically initialize with a value (actually, a global, unique id, such that two same values wouldn't exist even in different database tables).
Thanx
I have a bean:
class SomeBean {
private long number;
//... getter/setter
}
I need to assign a value to to SomeBean.number automatically, when it's persisted with the EntityManager.
Are there any annotations that would do the job? GeneratedValue didn't help, as much as I tried. Note that SomeBean.number is not an id. It's just a field which I need to automatically initialize with a value (actually, a global, unique id, such that two same values wouldn't exist even in different database tables).
Thanx