I'm feeling really stupid having to ask this. But I've been looking at my code for 4 hours and can't figure it out. I have rebuild my database several times and can't get it to work. One of my tables isn't being created for some reason. I have 4 tables game, developer, gameimage and user. User isn't being created but the other are being created perfectly and working. I'm sure it's a stupid mistake but I just don't see it. If someone could just tell me why this might be happening that would be great. I'm using toplink
Here is my code:
persistence xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="GameDatabasePU" transaction-type="RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<class>domainmodel.Game</class>
<class>domainmodel.GameImage</class>
<class>domainmodel.Developer</class>
<class>domainmodel.User</class>
<properties>
<property name="toplink.jdbc.user" value="app"/>
<property name="toplink.jdbc.password" value="app"/>
<property name="toplink.jdbc.url" value="jdbc:derby://localhost:1527/Gamedatabase;create=true"/>
<property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>
</persistence>
User:
@Entity
public class User {
@Id
private String username;
private String password;
private String firstName;
private String surname;
public User() {
}
public User(String naam, String pas){
setUsername(naam);
setPassword(pas);
}
public User(String naam, String pas, String firstName, String surname){
setUsername(naam);
setPassword(pas);
setFirstName(firstName);
setSurname(surname);
}
public void setUsername(String naam){
this.username=naam;
}
//methods
}