error: ';' expected in Generated classes
in an example generated class from concrete class called FeedModel, FeedModel$Container.java loadFromCursor() has several errors
there are several errors in these generated classes where a semicolon ';' is placed after 2 closing parenthesis ')' when there should only be 1 closing parenthesis.
Same problem here. dk why, when removed private worked perfectly
Not sure how that happened but what does your model look like? Just curious about the ; after 2 closing parenthesis issue.
i've removed usage of dbflow because of a few issues (generated files were causing compile time errors as described above, one to many relationships seemed to work sometimes but not always) but the example model causing issues was:
public class FeedModel extends BaseModel {
public interface Columns extends BaseColumns {
String NAME = "col_name";
}
@Column(name = Columns._ID)
@PrimaryKey(autoincrement = true)
public long id;
@Column(name = Columns.NAME)
public String name;
}
i basically had to remove all getters/setters and change the private fields to public which was not fun.
my model:
@Table(databaseName = GAUDIDatabase.DB_NAME, tableName = AQL.ENDPOINT) @TableEndpoint(name = AQL.ENDPOINT, contentProviderName = "GAUDIContentProvider") @ModelContainer public class AQL extends BaseModel{
public static final String ENDPOINT = "AQL";
@ContentUri(path = AQL.ENDPOINT,
type = ContentUri.ContentType.VND_MULTIPLE + ENDPOINT)
public static Uri CONTENT_URI = ContentProviderUtils.buildUri(ENDPOINT);
public interface Columns {
String AQL_ID = "aql_id";
String AQL_NAME = "aql_name";
String AQL_SERVER_ID = "aql_server_id";
String AQL_TIMESTAMP = "aql_timestamp";
}
@Column(name = Columns.AQL_ID)
@PrimaryKey(autoincrement = true)
Long aql_id;
@Column(name = Columns.AQL_NAME)
String aql_name;
@Column(name = Columns.AQL_SERVER_ID)
Long server_id;
@Column(name = Columns.AQL_TIMESTAMP)
DateTime timestamp;
all were private fields...had to remove them cz of exception
If you want you're fields as private, you can add accessors of the fields in the format of: fieldName => getFieldName(), setFieldName()
As long as those methods are accessible.
so i did what you said and i'm sorry but i don't think it's solves my problem... even with accessors my containers in toModel() using model.fieldName that gives me access error and still getting ; error in modelContainer.put(), it generates more ")" then should. ex: modelContainer.put("aql_id",null)); Thank you!
Same issue here. It seems to always happen when I attempt using @ModelContainer
Same issue here, as OptimistNot stated, there is an unnecessary ")" that makes this compile error.
will check this out for 2.2
Are sure that it is fixed in 2.2 ? I've just checked out this version and the same problem happen when I annotate a BaseModel class with @ModelContainer annotation.
Sorry guys! it will be in 2.2.1.
Hi, this bug still exists in 2.2.1 . It occures with @ModelContainer annotation