You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using norm and I would say I like the simplicity very much. Thanks for the great library.
Lately I tried using norm with kotlin but I did not manage to get the Id autogeneration to work. The Id field was also not marked as a primary key. Would you mind giving a full example in kotlin like the one you have given for java
Here is what I had:
@Table(name = "employees")
data class Employee(
@Column(name = "number") val number: String,
@Column(name = "name") var name: String,
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = -1) {
}
I also tried(but did not also work):
@Table(name = "employees")
data class Employee(
@Column(name = "number") val number: String,
@Column(name = "name") var name: String) {
@Id
@GeneratedValue
public var id: Long = -1
}
The text was updated successfully, but these errors were encountered:
Sorry for the late response. There is no error but it does not work as expected. Basically when you run db.createTable(Employee()) it does not mark the id as primary and when you run db.insert(employee) it does not autogenerate a value for the id.
If you have some time you can try to convert the java example and see.
I have been using norm and I would say I like the simplicity very much. Thanks for the great library.
Lately I tried using norm with kotlin but I did not manage to get the Id autogeneration to work. The Id field was also not marked as a primary key. Would you mind giving a full example in kotlin like the one you have given for java
Here is what I had:
I also tried(but did not also work):
The text was updated successfully, but these errors were encountered: