-->
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: @Column problems
PostPosted: Sun Mar 16, 2008 6:30 am 
Newbie

Joined: Mon Jul 23, 2007 4:20 am
Posts: 5
Location: Romania
Hello everyone,
I have developed an application using seam, but for every column database that is composed using "_" character, seam makes the entity without "_" character and adds a @Column. For example I have in user table "first_name" but in the class firstName with @Column(name = "first_name").
The application doesn't deploy, with the following error :

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:ear=blv.ear,jar=blv.jar,unitName=blv
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing column: firstName in public.user
I Depend On:
jboss.jca:service=DataSourceBinding,name=blvDatasource
Depends On Me:
jboss.j2ee:ear=blv.ear,jar=blv.jar,name=LoginController,service=EJB3
jboss.j2ee:ear=blv.ear,jar=blv.jar,name=UserBean,service=EJB3

So you can see that @Column has no effect. I am using postgresql 8.2 and driver postgresql-8.2-506.jdbc4.jar.
Can anyone help me ?
Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 11:20 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
It's clear that it's using the default naming strategy (which doesn't use _) and it's not picking up your @Column annotation.

Did you put your @Id on the id field or on the id getter?
If it's on the id field, your @Column should be on the field, and vica versa.

_________________
http://www.ohloh.net/accounts/ge0ffrey


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.