Stack over flow View (one-to-many) using "{}"
Java platform for fast time-to-market of business applications
Brought to you by:
javierpaniza
Hi ~ ! I love Openxava
I am using Openxava 4.5.1
I found Stack Overflow in @View using "{ } "
for example
---------------------------------------------------------------------
@View( members = "id; name{names}")
Class A
{
private Long id;
@OneToMany(mappedBy = "id2", cascade = CascadeType.ALL)
private Set<Name> names = new HashSet<Name>();
}
@View( members = "id2; a{a}")
Class Name
{
private Long id2;
@ManyToOne
private A a;
}
------------------------------------------------
This Stack Overflow is not found older version.
When change the Name's view @View( members = "id2; a") , It is fine.
I want to design the view a{a},b{b},c{c}}
HI PPink,
it's not a bug it's the way you define your views. When OpenXava generates the default views it tries to not create infinite recursive structures, but if you define your own views using @View is in your hand to avoid the infinite recursive structures.
In this case you can just add a Simple @View definition and use it, in this way:
@Entity
@Views([
@View( members = "id; name{names}"),
@View( name="Simple", members = "id")
])
class AA {
}
@Entity
@View( members = "id2; a{a}")
class Name {
}
I testesd the above (groovy) code and it works.
It better that you put first your problems in Help forum and when we are sure that it's a bug we can add it here. In this way, others can help you to solve the problem and the thread would be there for future references.