aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate @Table annotation, database schemas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate @Table annotation, database schemas" Watch "Hibernate @Table annotation, database schemas" New topic
Author

Hibernate @Table annotation, database schemas

Marcel van der Ven
Greenhorn

Joined: Mar 20, 2010
Posts: 14
Hello,

I am learning hibernate through Netbeans 6.8.
I have created a test database into SQL Server 2008 and want to connect to a table
using a Entity class, this works fine. But when I move my table to a schema and want to use schema names
in Hibernate, Hibernate can not find the table.

I use the annotation:
@Table(name = "Employee", schema = "HR")

Netbeans give me a error on the name and schema keyword, now
when I change name into appliesTo and leave my schema out I get no error but the table can not
be found? I tryed to specify the table name as follows:

@Table(appliesTo="HR.Employee")

but this doesn't work?

I search the Internet and I found on the JBOSS site the @Table page, but there the do not say anything about
schema?? @Table webpage

Does anybody now how to specify a schema in Hibernate?

Thanks,

Marcel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate @Table annotation, database schemas