Can you please enter an issue for this in JIRA?
http://issues.appfuse.org/browse/APF
Thanks,
Matt
On 7/5/07, Rick Guo <[EMAIL PROTECTED]> wrote:
When two model class has reference to each other.
objectToRequestParameters() method in BaseControllerTestCase has a bug.
The demo model I used has two Entities: Employee and Desk. They are OneToOne
Bidirectional mapping.
Here are the code snipet:
@Entity
public class Employee extends BaseObject {
@Id @GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "employee_id")
private Long id;
@Column(nullable = false)
private String name;
@OneToOne
@JoinColumn(name = "desk_id")
private Desk desk;
// Getters and Setters
// Override methods
}
@Entity
public class Desk extends BaseObject {
@Id @GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "desk_id")
private Logn id;
@Column(name = "desk_name")
private String deskName;
@OneToOne(mappedBy = "desk")
private Employee owner;
//Getters and Setters
// Override methods
}
Daos and Managers...
So in EmployeeFormController's testSave() method
I could get an Employee with property desk from the database, Then I call
objectToRequestParameters(employee, request) on the
populated employee.
the test will failed for:
java.lang.OutOfMemoryError: Java heap space
I debugged testSave() method
The property desk:Desk in Employee has a rpoperty owner. It is of type
Employee.
So this Bidirectional incurs infinite loop and finally get OutOfMemoryError.
I am a newbie to lightwight java. Excuse me for any silly question. Thanks
all.
________________________________
梦 幻 西 游,千 万 人 的 选 择,你 的 选 择
--
http://raibledesigns.com