openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vivek" <vive...@geojit.com>
Subject Regarding Fetch groups in OpenJPA
Date Thu, 18 Oct 2007 06:30:24 GMT
Problem :Regarding Fetch groups in OpenJPA.

 

public class EmployeePK {

 

@Column(name = "EmployeeID", nullable = false)

 

private long employeeID;

 

@Column(name = "SerialNo", nullable = false)

 

private int serialNo;

 

}

 

public class Employee {

 

@EmbeddedId

 

protected EmployeePK employeePK;

 

private String firstName;

 

private String lastName;

 

@ManyToOne private Department dept;

 

}

 

public class Department {

 

@Id private int id;

 

private String departmentName;

 

}

 

 

This is the sample scenario.

There are 3 entity classes, one is the primary key class.

Here normally if i am not using fetch group feature in OpenJPA, during
retrieval all fields will retrieved from employee and department tables.

But i need some fields from both the tables to be fetched first.

By seeing fetch group documentation, i couldnt get a full idea of how to
configure fetch groups for related entities.

So please give a sample configuration for the above scenario.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message