Fixed
Status Update
Comments
se...@google.com <se...@google.com> #2
I should probably elaborate on that a bit more here :P. The ideal case would be that data classes written in other modules work the same when consumed. A standard data class (no secondary constructors, `val` properties) works fine when in the same module. The errors produced are also pretty confusing. They'll usually give what they read from the bytecode (constructor params called "var0" or the like) and reports missing setters for fields without names of said fields.
fl...@google.com <fl...@google.com>
yb...@google.com <yb...@google.com> #3
I can confirm the bug and the workaround. The same problem arises when you use a data-class from a library with @Embedded
yb...@google.com <yb...@google.com> #5
given that log, looks like kotlin again not generating proper parameter names for methods.
Description
Version used: 1.0.0-alpha8
Given the following entity:
@Entity(tableName = "foo")
public class FooEntity {
@PrimaryKey
@ColumnInfo(name = "bar")
private String bar;
@ColumnInfo(name = "baz")
private String baz;
public FooEntity(String bar, String baz) {
this.bar= bar;
this.baz= baz;
}
}
I'm able to insert the follwing entities into the database without errors:
new FooEntity(null, "one");
new FooEntity(null, "two");
new FooEntity(null, "three");
Is this behaviour intended? Should PrimaryKey columns be NonNull by default (not sure especially with multi column primary keys and auto increment columns)?
If null is a valid value for a primary key column, I believe there should by a primary key violation if I try to put the same key multiple times into the table.