-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem specifying column name on id property
PostPosted: Sun Feb 12, 2006 4:48 pm 
Newbie

Joined: Tue Mar 09, 2004 11:17 pm
Posts: 8
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 8:52 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I've added a test, this works fine

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.