Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Setter Methods not getting invoked with eclispe link(Setter Methods not getting invoked with eclispe link)
Setter Methods not getting invoked with eclispe link [message #1229500] Thu, 09 January 2014 15:16 Go to next message
Sendhil Kumar is currently offline Sendhil KumarFriend
Messages: 7
Registered: January 2014
Junior Member
Hi All,

While doing following querying,

List<JurisdictionVoLink> jurisdictionList = (List<JurisdictionVoLink>)entityManager.createQuery("SELECT x FROM JurisdictionVoLink x").getResultList();

I could able to get the list properly.

But only my default no argument constructor getting invoked. And no setter methods are being invoked. I have to do some additonal operation on my setters, so I want those to be invoked on every query.

Actually with hibernate, all setters will be invoked. Am new to JPA, not sure why its not happening with this.

Can anyone help me on this. Below I have shared my entity mapping and entity class.

Following are the properties am using in persistence.xml,

<property name="eclipselink.weaving" value="false"/>
<property name="eclipselink.cache.shared.default" value="false"/>

My entity mapping,

<entity name="JurisdictionVoLink" class="" >
<table name="VEM_JURISDICTION"></table>
<id name="dbId" type="java.lang.Long" >
<column name = "JURISDICTION_ID"/>
<basic name="description" type="java.lang.String" >
<column name="DESCRIPTION"/>

And my entity class,

public class JurisdictionVoLink implements, Cloneable {

private Long dbId;
private String description;

/** default constructor */
public JurisdictionVoLink() {
System.out.println("default constructor JurisdictionVoLink invoked");

public JurisdictionVoLink(Long dbId, String description) {
System.out.println("All argument constructor JurisdictionVoLink invoked");
this.dbId = dbId;
this.description = description;

public Long getDbId() {
return dbId;
public void setDbId(Long dbId) {
this.dbId = dbId;
public String getDescription() {
return description;
public void setDescription(String description) {
this.description = description;

public JurisdictionVoLink clone(){
System.out.println("Clone JurisdictionVoLink invoked");
JurisdictionVoLink obj = null;
obj = (JurisdictionVoLink) super.clone();
}catch(CloneNotSupportedException e){
return obj;

public boolean equals(Object obj){
System.out.println("equals JurisdictionVoLink invoked");
JurisdictionVoLink workItem = null;
workItem = (JurisdictionVoLink) obj;
if(workItem.dbId.equals(dbId))return true;
return false;


Re: Setter Methods not getting invoked with eclispe link [message #1229576 is a reply to message #1229500] Thu, 09 January 2014 18:42 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1300
Registered: July 2009
Senior Member
EclipseLink orm.xml processing seems to default to field access, which might be different in other providers.
See for information on the access type.

If you want consistent portable code, you will need to specify the access type in your entity, for example:
<entity name="JurisdictionVoLink" class="" access="PROPERTY">

Best Regards,
Previous Topic:How to configure Inner Class as an Entity in Mapping File
Next Topic:parse orm mapping in json format
Goto Forum:

Current Time: Tue Jun 19 22:26:22 GMT 2018

Powered by FUDForum. Page generated in 0.01539 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top