Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ollie trying to create table for abstract classes #35

Open
ayarulin opened this issue Jan 4, 2015 · 0 comments
Open

Ollie trying to create table for abstract classes #35

ayarulin opened this issue Jan 4, 2015 · 0 comments

Comments

@ayarulin
Copy link
Contributor

ayarulin commented Jan 4, 2015

I've extracted common fields into base abstract class, but run into an issue:

@Table("")
public abstract class BaseModel extends Model{

@Column("created_at")
@NotNull
public Date createdAt;

@Column("updated_at")
@NotNull
public Date updatedAt;
}

@Table("notes")
public class Note extends BaseModel{
}

At this point I expected that Ollie will create table notes with created_at and updated_at columns, but instead got this error

java.lang.RuntimeException: Unable to get provider com.example.ContentProvider: android.database.sqlite.SQLiteException: near "(": syntax error (code 1): , while compiling: CREATE TABLE IF NOT EXISTS  (_id INTEGER PRIMARY KEY AUTOINCREMENT, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL)

Obviously compiler trying to process abstract class BaseModel since it has @Table annotation, but i am not able to omit it, because it is required by @Column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant