2

I have a JPA TableXXX class that contains the following field:

@Column(name = "CreatedOn")
@NotNull
private Date createdOn;

When I compile and deploy my app it throws an error:

Caused by: org.hibernate.HibernateException: Missing column: created_on in TABLEXXX

I am using Hibernate 3.5.5 and Oracle 10g. the CreatedOn column is stored as Timestamp in the database. Why does Hibernate add an underscore between 'created' and 'on'?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
newguy
  • 5,668
  • 12
  • 55
  • 95

1 Answers1

4

Double check that you're not using a custom naming strategy other than the default one for EJB3. A custom naming strategy would be declared using the hibernate.ejb.naming_strategy property (could be in the persistence.xml or programatically, depending on how you use JPA).

References

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • Thank you. I also find this link: http://stackoverflow.com/questions/376093/hibernate-column-name-issues and follow the advice there to use DefaultNamingStrategy. – newguy Nov 10 '10 at 23:36