-->
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: Hibernate Annotations without EJB
PostPosted: Sun May 11, 2008 2:49 am 
Newbie

Joined: Wed Feb 06, 2008 1:23 am
Posts: 3
Is it possible to use Hibernate with Annotation without any EJBs. That means, my application contains only Web Project. Where to place the persistence.xml file in the web project.

My constraint is I need to use Annotations. that means all the table-java object mappings should be configured with annotaions and not through configuration files. Only persistence.xml file should be present. In this case where to store the persistence.xml file. If I use EJBs I can place the same in META-INF folder.

Please help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 3:09 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
You put it in the same place as you would with an EJB3 application. The only difference is that rather than the container noticing your persistence.xml and bootstrapping the PU, you must do it yourself. You'll need EntityManager and Annotations. The former is required if you want persistence.xml compatibility. The latter does the binding using annotations. Read the manual:

http://www.hibernate.org/hib_docs/entit ... tstrapping

-Chris

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


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.