hello
i facing a strange problem in my code.. first little bit explain my DB
i have Postgres DB in which have table Client,..
Client atble have fields like
clientID *sequence
ClientName *Filed
ClientEmail *Primary Key
now in hibernate i want to assign the generator name in the field ClientID
i using in Annotation fr mapping
bt when i do that
@Entity
@javax.persistence.SequenceGenerator(
name="SEQ_Client",
sequenceName="client_clientid_seq",
allocationSize=1)
@Table(name="client")
public class Client implements Serializable,Comparable<Client>{
@Id
private String businessname;
@Column(name="clientid")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_Client")
private Integer clientid;
but it not taking the sequence Generator on the Filed wheich is not a primary Key and not increment the value when i try to save data in Client table...
so help me out how i can set the Sequence Genrator on simple Filed in hibernate
waiting fr response....
|