-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate 4.2.7 generates two columns for one attribute
PostPosted: Sat Apr 19, 2014 12:09 pm 
Newbie

Joined: Mon Sep 07, 2009 3:05 am
Posts: 2
Hi there .. I use hibernate and hibernate.hbm2ddl.auto to deploy the entities to my postgresql db. The problem is that for one attribute in my entity, hibernate generates two columns in database. For example

Code:
@Entity
public class Person{

   private String myName;

}


Then in the database I will get two columns. One with name myname and one with name my_name. The same happens with tables. If I have a table with name PersonInfo then I will end up with two same tables ... One with name personinfo and one with name person_info.

my configuration

Code:

hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update



If I set the @Column annotation to each field with a table field then problem is resolved .. but I really want to skip this. For example if I do something like

Code:

@Column(name = "my_name")
private String myName;



Then it's fine. The same goes for tables by using @Table(name = "person_info")

What am I doing wrong


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

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.