[
http://jira.jboss.com/jira/browse/JBIDE-265?page=all ]
Max Andersen closed JBIDE-265.
------------------------------
Resolution: Out of Date
Need a recepie for creating a j2se entity manager project using
reversed ejb3 entities
--------------------------------------------------------------------------------------
Key: JBIDE-265
URL:
http://jira.jboss.com/jira/browse/JBIDE-265
Project: JBoss Tools
Issue Type: Feature Request
Components: ejb3, Hibernate
Affects Versions: 1.5 Final
Reporter: Scott M Stark
Assigned To: Max Andersen
A test usage of the hibernate tools I'm having trouble putting together is to reverse
a database schema into ejb3 style annotated pojos, and put together the resulting
hibernate.cfg.xml + entities with a simple main that uses that j2se compatible
EntityManager to work with the generated entities. The persistence.xml just references the
hibernate.cfg.xml:
<entity-manager>
<name>manager1</name>
<properties>
<property name="hibernate.ejb.cfgfile"
value="/cfg/hibernate.cfg.xml"/>
</properties>
</entity-manager>
and the main driver is trying to create an entity using one of the generated MsUser
ejbs:
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class PopulateTables
{
public static void main(String[] args)
{
// Use persistence.xml configuration
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("manager1");
EntityManager em = emf.createEntityManager();
MsUser user = new MsUser();
MsUserId id = new MsUserId("jduke", "jduke",
"theduke");
user.setId(id);
em.persist(user);
em.close();
emf.close();
}
}
Step 1 would just be a tutorial/recepie on how to setup such a project.
Step 2 would be to directly support such a project skeleton such that I can just hit
"reverse to jsr-220 j2se application" button in the tools dialog to pull these
artifacts together.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira