Well this works for me, when I want to put other value than default in schema in DB Postgresql, setting in the xml:
Code:hibernate.default_schema=${hibernate.default_schema}In upper case, and the @Id @GeneratedValue is the domain class stay like this:Code:hibernate.default_schema = "DBMERCANCIAS"
I take a error about that the hibernate-secuence is not create, the only way that I do work this is change the strategy=GenerationType.SEQUENCE, and always put the sequenceName without the simbol _Code:@Entity @Id @Table(name ="VEHICULO") public class Vehiculo implements Serializable,DomainObject { private static final long serialVersionUID = 1L; private Long id_vehiculo; private String marca; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name ="`Id_Vehiculo`") public Long getId_vehiculo() { return id_vehiculo; }
I will apreciated if somebody work this in other way, thanks.Code:@Entity @SequenceGenerator( name="SEQ_STORE", sequenceName="sequencevehiculo", initialValue= 100 , allocationSize=20) @Table(name ="VEHICULO") public class Vehiculo implements Serializable,DomainObject { private static final long serialVersionUID = 1L; private Long id_vehiculo; private String marca; @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_STORE") @Column(name ="`Id_Vehiculo`") public Long getId_vehiculo() { return id_vehiculo; }


Reply With Quote
