-
-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
Hi, this is my first git bug report so please bear with me.
For a project I have been trying to use the annotations as per the documentation. However, when I have:
@DatabaseTable(tableName = "Profiles")
public class Profile {
@DatabaseField(generatedId = true)
private int profile_id;
}
@DatabaseTable(tableName = "Workspaces")
public class Workspace {
@DatabaseField(generatedId = true)
private int workspace_id;
@DatabaseField(foreign = true, foreignAutoCreate = true, foreignAutoRefresh = true, canBeNull = false)
private Profile profile;
}
public DatabaseManager() throws SQLException, IOException {
this.databaseUrl = "jdbc:sqlite:ORMLiteTest.db";
this.connectionSource = new JdbcConnectionSource(databaseUrl);
this.profileDAO = DaoManager.createDao(connectionSource, Profile.class);
this.workspaceDAO = DaoManager.createDao(connectionSource, Workspace.class);
TableUtils.createTableIfNotExists(connectionSource, Workspace.class);
TableUtils.createTableIfNotExists(connectionSource, Profile.class);
connectionSource.close();
The resulting two tables created have their primary key, and for Workspaces, it will have the profile_id field as NOT NULL, but it won't have the Foreign Key tag set.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels