question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.9.14] relation bug

See original GitHub issue
@Entity
public class NewsGroup {
    @SerializedName("id")
    @Id(assignable = true)
    private long id;

    @SerializedName("name")
    private String name;

    @SerializedName("icon")
    private String icon;

    @SerializedName("color")
    private String color;

    @SerializedName("group")
    @Backlink
    List<NewsCategory> groups;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public List<NewsCategory> getGroups() {
        return groups;
    }

    public void setGroups(List<NewsCategory> groups) {
        this.groups = groups;
    }
}
@Entity
public class NewsCategory {
    @SerializedName("id")
    @Id(assignable = true)
    private long id;

    @SerializedName("name")
    private String name;

    @SerializedName("icon")
    private String icon;

    @SerializedName("color")
    private String color;

    @Relation
    NewsGroup group;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public NewsGroup getGroup() {
        return group;
    }

    public void setGroup(NewsGroup group) {
        this.group = group;
    }
}

when build project :

NewsCategoryCursor.java :
Error:(51, 45) error: cannot find symbol variable groupToOne
Error:(70, 37) error: cannot find symbol variable groupToOne
NewsGroup_.java
Error:(106, 30) error: cannot find symbol variable groupToOne

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DJafaricommented, Aug 15, 2017

goood, thanks, clean model is good idea, thanks for it

1reaction
greenrobotcommented, Aug 15, 2017

Right, to-ones have to be adjusted. We have to update the docs. Change

@Relation NewsGroup group;

to

ToOne<NewsGroup> group;

Getters can return group.getTarget() and setter should do group.setTarget(group). Note that you do not have to init the ToOne field by hand; this is done by ObjectBox.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug listing with status CONFIRMED as at 2022/12/14 03:46:34
Bug :4315 - "[Future EAPI] add support for version ranges in DEPEND" ... Accounting Connection Manager for Linux)" status:CONFIRMED resolution: severity: ...
Read more >
Potential bug broke my relationship with FW during FW quest line ...
I'm guessing it's meant to turn over to FW further during the quest line, so it spawned FW defense fleet, even though it...
Read more >
Bug #1954956 “[amdgpu] System crash” : Bugs : linux package ...
System crashes about 3 times a day; no appearant relation to application or process or triggering situation. Happens constantly.
Read more >
Release Notes for Cisco Video Surveillance IP Camera 8000 ...
These release notes provide important information for the Cisco Video Surveillance IP Camera 8000. Series, Release 1.0.9-14, which applies ...
Read more >
Is there a work-around or fix to the Starcraft online chat bug for ...
Anyway, for the time being I'm using wine 0.9.14 since the other bugs that I haven't mentioned don't appear in that old version....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found