1

I have a JPA project deployed on JBoss7 in Eclipse Luna (4.4.1).

I've defined a datasource in the server and referenced it in my persistence.xml file:

<jta-data-source>java:/testdb</jta-data-source>

I've created an entity bean from scratch and everything works great. But... is there any Eclipse tool, external plugin or else that connects to the database, reads the table and autogenerates such entities?

I managed to do that by using a local JDBC connection, but now I can't find a way to do that with a jta datasource.

1 Answer 1

2

I don't see any mention of Hibernate in your post, but you can have a look at Hibernate Tools to reverse engineer your POJOs. It should do just that.

From the docs:

The most powerful feature of Hibernate Tools is a database reverse engineering tool that can generate domain model classes and Hibernate mapping files, annotated EJB3 entity beans, HTML documentation or even an entire JBoss Seam application in seconds!

Sign up to request clarification or add additional context in comments.

2 Comments

I didn't mention Hibernate because I'm using a pure JPA approach, even though JBoss uses Hibernate persistence provider to implement JPA, so... I'll give it a try!
My bad... I was misunderstanding. Actually, it was already working, but when I went to "JPA Tools > Generate Entities from Tables..." and it was asking me for a JDBC connection coordinates, I thought those coordinates where going to overwrite my persistence.xml settings. And I was wrong. Thanks anyway for the hint, nice tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.