Hi
My problem is I can't generate quite the correct schema using annotations and hibernatetools. Everything seems to be ok, except for the name of the primary key column. Look at the code, I want the id column to be named "customer_id", but it is generated as id (the default coming from the property). I believe this might be a bug because I checked the tests in annotations and no one tries to set a different name into an id column.
I'm not sure if the problem is in annotations or tools, so I'm posting it here. Sorry if is the wrong forum.
Alex.
Hibernate version:
Hibernate 3.1.2, Annotations 3.1beta8, Tools 3.1beta4
Mapping documents:
Code:
@Id @GeneratedValue(strategy=GenerationType.AUTO, generator="CUSTOMER_ID_SEQ")
@Column(name="customer_id", length=19)
public long getId() {
return id;
}
Name and version of the database you are using:PostgreSQL 8.2
The generated SQL (show_sql=true):Code:
INFO: table not found: CUSTOMER
create table CUSTOMER (id int8 not null, EMAIL_ADDRESS varchar(40), firstname varchar(255), gender varchar(255), occupation varchar(50), partner_name varchar(50), address_line1 varchar(40), address_line2 varchar(40), address_line3 varchar(40), town varchar(40), county varchar(40), postcode varchar(10), DATE_OF_BIRTH timestamp, underage bool, created timestamp, created_by int8 not null, last_upd timestamp, last_upd_by int8 not null, country varchar(40), title varchar(255), status varchar(255), surname varchar(255), CUSTOMER_BANK_ID int8, primary key (id))
alter table CUSTOMER add constraint FK52C76FDE50CA03DC foreign key (CUSTOMER_BANK_ID) references CUSTOMER_BANK