| Re: [eclipselink-users] How can I generate tables from entities? |
|
Hello, Michael, thank you very much for your fast and helpful response. Your unsigned persistence jar-file really did it, the table generator works fine now. In my case, which is admittedly a very simple one, it is even possible to generate tables with <property name="eclipselink.ddl-generation" value="create-tables" /> I tried to boil my entity declaration down to the absolute necessary, the result is attached. Some further feedback: 1. I changed all the prefixes of the properties in persistence.xml to javax.persistence as you recommended. But I'm still getting the follwing output lines: [EL Info]: property eclipselink.jdbc.user is deprecated, property javax.persistence.jdbc.user should be used instead. [EL Info]: property eclipselink.jdbc.driver is deprecated, property javax.persistence.jdbc.driver should be used instead. [EL Info]: property eclipselink.jdbc.url is deprecated, property javax.persistence.jdbc.url should be used instead. [EL Info]: property eclipselink.jdbc.password is deprecated, property javax.persistence.jdbc.password should be used instead. 2. With the line <property name="javax.persistence.ddl-generation.output-mode" value="both"/> I tried to prompt EclipseLink to output the DDL in a text file, as well, which I then couldn't find in the directory specified in the XML element <property name="javax.persistence.application-location" value="C:\JPA"/> How can one call the table generator from within a program? Let me say that I'm really impressed by your fast and effective support. best regards Gerhard Michael O'Brien schrieb: Gerhard, -- Prof. Dr. Gerhard Kratz Fachhochschule Frankfurt am Main Fachbereich 2: Informatik und Ingenieurwissenschaften Nibelungenplatz 1 60318 Frankfurt am Main WWW: http://www.fh-frankfurt.de/~g_kratz http://bscw.fh-frankfurt.de |
package employee1;
import javax.persistence.*;
import java.math.*;
@Entity
@Table(schema="test")
public class Employee {
@Id @GeneratedValue
private BigInteger personId;
private String name;
public Employee() {
}
public BigInteger getPersonId() {
return this.personId;
}
public void setPersonid(BigInteger personId) {
this.personId = personId;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
}