-->
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: JPA config via Hibernate Configuration
PostPosted: Fri Oct 21, 2011 1:07 pm 
Newbie

Joined: Fri Oct 21, 2011 1:00 pm
Posts: 3
I don't know if this is realy possible.
I'm trying to use JPA entities (with annotations) via Hibernate Configuration, but is sending me an error:
org.hibernate.MappingNotFoundException: resource: org/rds4jpa/base/config/domain/KeyGroup.hbm.xml not found

I don't have hbm.xml files since it is JPA annotated.
My configuration:

Configuration cfg = new Configuration();

cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");

cfg.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver");
cfg.setProperty("hibernate.connection.url", "jdbc:postgresql://localhost:5432/jpa_test");
cfg.setProperty("hibernate.connection.username", "postgres");
cfg.setProperty("hibernate.connection.password", "***********");

cfg.setProperty("hibernate.show_sql", "true");
cfg.setProperty("hibernate.hbm2ddl.auto", "create-drop");

//org.rds4jpa.base
cfg.addClass(KeyGroup.class);
cfg.addClass(KeyValue.class);

//org.rds4jpa.audit
cfg.addClass(Audit.class);
cfg.addClass(AuditLine.class);

//org.rds4jpa.security
cfg.addClass(User.class);
cfg.addClass(LinkUserRole.class);
cfg.addClass(Role.class);


Top
 Profile  
 
 Post subject: Re: JPA config via Hibernate Configuration
PostPosted: Fri Oct 21, 2011 1:16 pm 
Newbie

Joined: Fri Oct 21, 2011 1:00 pm
Posts: 3
Sorry, my bad!!
I need to use addAnnotatedClass(...) instead of addClass(...)


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.