4

I have a question regarding the class integration in the persistence xml.

Is something like this possible?

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="ranea">
        <class>com.dal.pojo.*</class>
    </persistence-unit>
</persistence>

I know that this does not work....but I have a rather big database structure and I would appreciate an answere how to include my pojo classes in the persistence unit easily.

RAN
  • 508
  • 6
  • 18
  • 3
    see http://stackoverflow.com/questions/1780341/do-i-need-class-elements-in-persistence-xml – Gab Mar 05 '13 at 16:39
  • I have a similar answer before, which hopefully can provide choices from different aspects. http://stackoverflow.com/a/13756652/395202 – Adrian Shum Jan 22 '14 at 01:54

1 Answers1

2

If you're using Eclipse, you can right click on persistence and use "synchronize class list".

Walid Saad
  • 951
  • 1
  • 8
  • 14