-
Notifications
You must be signed in to change notification settings - Fork 306
Closed
Description
@Entity
public class Product {
@Id
private long id;
private String title= "Product №";
private String desc;
public ToOne<Category> category;
public ToOne<Category> getCategory() {
return category;
}
public void setCategory(ToOne<Category> category) {
this.category = category;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title= title;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
@Entity
public class Category {
@Id
private long id;
private String title;
public Category(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
boxStore.runInTx(new Runnable() {() ->
Category category = new Category("Stuff");
categoryBox.put(category);
Product product = new Product();
product.category.setTarget(category); // product.category NPE
productBox.put(product);
});
product.category is null
Metadata
Metadata
Assignees
Labels
No labels