Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endless toString loop for bidirectional reference #697

Closed
dbaggett opened this issue Oct 6, 2017 · 1 comment
Closed

Endless toString loop for bidirectional reference #697

dbaggett opened this issue Oct 6, 2017 · 1 comment
Labels

Comments

@dbaggett
Copy link

dbaggett commented Oct 6, 2017

I cannot get around this stack overflow error:

at java.util.AbstractCollection.toString(AbstractCollection.java:462) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskListDataEntity.toString(TaskListDataEntity.java:368) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskItemDataEntity.toString(TaskItemDataEntity.java:539) at java.lang.String.valueOf(String.java:2994) at java.lang.StringBuilder.append(StringBuilder.java:131) at java.util.AbstractCollection.toString(AbstractCollection.java:462) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskListDataEntity.toString(TaskListDataEntity.java:368) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskItemDataEntity.toString(TaskItemDataEntity.java:539) at java.lang.String.valueOf(String.java:2994) at java.lang.StringBuilder.append(StringBuilder.java:131) at java.util.AbstractCollection.toString(AbstractCollection.java:462) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskListDataEntity.toString(TaskListDataEntity.java:368) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskItemDataEntity.toString(TaskItemDataEntity.java:539) at java.lang.String.valueOf(String.java:2994) at java.lang.StringBuilder.append(StringBuilder.java:131) at java.util.AbstractCollection.toString(AbstractCollection.java:462) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskListDataEntity.toString(TaskListDataEntity.java:368) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskItemDataEntity.toString(TaskItemDataEntity.java:539) at java.lang.String.valueOf(String.java:2994) at java.lang.StringBuilder.append(StringBuilder.java:131) at java.util.AbstractCollection.toString(AbstractCollection.java:462) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskListDataEntity.toString(TaskListDataEntity.java:368) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskItemDataEntity.toString(TaskItemDataEntity.java:539) at java.lang.String.valueOf(String.java:2994) at java.lang.StringBuilder.append(StringBuilder.java:131) at java.util.AbstractCollection.toString(AbstractCollection.java:462) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskListDataEntity.toString(TaskListDataEntity.java:368) at io.requery.proxy.EntityProxy.toString(EntityProxy.java:423) at com.bottlerocketstudios.infrastructure.requery.data.TaskItemDataEntity.toString(TaskItemDataEntity.java:539) at java.lang.String.valueOf(String.jav

OneToMany side:

@Entity
@Table(name = "task_list")
interface TaskListData : Persistable {

    @get:Key
    @get:Generated
    var id: Long

    var name: String

    @get:JunctionTable(type = OwnerData::class)
    @get:ManyToMany
    var owners: Set<PersonData>

    @get:OneToMany(mappedBy = "task_list_id", cascade = arrayOf(CascadeAction.SAVE, CascadeAction.DELETE))
    var tasks: Set<TaskItemData>

    var created: Timestamp

    var modified: Timestamp?
}

and the ManyToOne side:

@Entity
@Table(name = "task_item")
interface TaskItemData : Persistable {

    @get:Key
    @get:Generated
    var id: Long

    var name: String

    @get:ManyToOne
    @get:JoinColumn(name = "task_list_id")
    var task_list_id: TaskListData

    @get:ForeignKey(delete = ReferentialAction.NO_ACTION)
    @get:OneToOne
    @get:Column(name = "person_id")
    var assignee: PersonData?

    @get:Column(name = "due_date")
    var dueDate: java.sql.Date?

    @get:Column(name = "complete_flag")
    var isComplete: Boolean

    var created: Timestamp

    var modified: Timestamp?
}
@npurushe npurushe added the bug label Oct 7, 2017
@npurushe
Copy link
Contributor

npurushe commented Oct 7, 2017

1.4.1 has this fix thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants