[1.1.0] ToOne<Some> is null
See original GitHub issue@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
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How to setup your own MQTT Broker - O'Brien Labs
First install Mosquitto, which is the name of the MQTT software. ... If you stopped here and did sudo service mosquitto start you'll...
Read more >NetGuardian 420 - DPS Telecom
With the NetGuardian, you can: • Monitor 20 discrete alarms, 32 ping alarms, and up to 6 analog alarms. • Control remote site...
Read more >AP-51xx Access Point - Barcode Datalink
NOTE If using an AP-5131 model access point, a null modem cable is required. If ... After a downgrade from 1.1/1.1.0 to 1.0....
Read more >AP-51xx Access Point Product Reference Guide (Part - Yumpu
NOTEIf using an AP-5131 model access point, a null modem cable is required. ... After a downgrade from 1.1/1.1.0 to 1.0.
Read more >The Practical Guide to Public Key Infrastructures (version 1.5.0)
following parameters on both ends: -cipher NULL-SHA. ... integrity to one, some or all endpoints depending on who offered a certificate. When.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
ObjectBox modifies the constructor by doing byte code modification to add initialization code for ToOne and ToMany fields. If you mark the constructor private, ObjectBox can not call it when creating an object, hence the ToOne and ToMany are never initialized (
null
). -utClosing. Note that there were improvements to the transformer in the latest releases, including the new preview release
1.5.0-RC
. Please open a new issue with details if you encounter new issues. -ut