• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Xdoclet and Hbm2java

 
Venkat dasari
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In my project i am using hibernate along wih xdoclet. I am using hbm2java to generate pojo's. In my Enterprise beans i am using Xdoclet and to auto generate the code. In my ejbCreate() method it has parameters and i am trying to set the parameter to pojo's parameter. But since the attribute is private in pojo i am unable to access it. I am also adding a piece of code for clear understanding.

POJO:

public class OrgPOJO{
private Long orgId;
public int getOrgId(){return orgId; }
public void setOrgId(Long orgId){this.orgId = orgId;}
}

EnterpriseBean:

public class OrgBMP{
OrgPOJO pojo = new OrgPOJO
public OrgPK ejbCreate(orgId){
pojo.setOrgId(orgId);
}
since the pojo is doesnt have a public attribute...how do i set it's value...?? any idea??
}
 
Venkat dasari
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In my project i am using hibernate along wih xdoclet. I am using hbm2java to generate pojo's. In my Enterprise beans i am using Xdoclet and to auto generate the code. In my ejbCreate() method it has parameters and i am trying to set these parameters in ejbCreate() to pojo's parameter. But since the attribute is private in pojo i am unable to access it. I am also adding a piece of code for clear understanding.

POJO:

public class OrgPOJO{
private Long orgId;
public int getOrgId(){return orgId; }
public void setOrgId(Long orgId){this.orgId = orgId;}
}

EnterpriseBean:

public class OrgBMP{
OrgPOJO pojo = new OrgPOJO
/**This code must be auto generated. */
public OrgPK ejbCreate(orgId){
pojo.setOrgId(orgId);
/**-----*/
}
}
since the pojo doesnt have a public attribute...how do i set it's value...?? any idea??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic