Есть такой Entity Bean: | Код | @Entity @Table(name = "Organization", catalog = "organization", schema = "") public class Organization implements Serializable {
private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id", nullable = false) private Integer id; @Basic(optional = true) @Column(name = "companyId", nullable = true, updatable = false, insertable = false) private Integer companyId; @Basic(optional = false) @Column(name = "orgTypeId", nullable = false, updatable = false, insertable = false) private int orgTypeId; @Basic(optional = true) @Column(name = "parentOrgId", nullable = true, updatable = false, insertable = false) private Integer parentOrgId; @Basic(optional = false) @Column(name = "name", nullable = false, length = 255) private String name; @Basic(optional = false) @Column(name = "creationDate", nullable = false) @Temporal(TemporalType.TIMESTAMP) private Date creationDate; @Basic(optional = true) @Column(name = "updateDate", nullable = true) @Temporal(TemporalType.TIMESTAMP) private Date updateDate; @Basic(optional = false) @Column(name = "operator", nullable = false) private int operator; @OneToOne(fetch = FetchType.LAZY, optional = true) @JoinColumn(name = "companyId") private Organization company; @ManyToOne(fetch = FetchType.EAGER, optional = false) @JoinColumn(name="orgTypeId", referencedColumnName="id") private OrganizationType orgType; @ManyToOne(fetch = FetchType.LAZY, optional = true) @JoinColumn(name = "parentOrgId", referencedColumnName = "id") private Organization parentOrganization; @OneToMany(mappedBy = "parentOrganization", fetch = FetchType.LAZY) private Set<Organization> subOrganizations;
public Map getModel() { Map orgMap = new HashMap(); orgMap.put("id", this.id); orgMap.put("companyId", this.companyId); orgMap.put("orgTypeId", this.orgTypeId); orgMap.put("parentOrgId", this.parentOrgId); orgMap.put("name", this.name); return orgMap; }
public Organization() { }
public Organization(Integer id) { this.id = id; }
public Organization(Integer id, int orgTypeId, String name, Date creationDate, Date updateDate, int operator) { this.id = id; this.orgTypeId = orgTypeId; this.name = name; this.creationDate = creationDate; this.updateDate = updateDate; this.operator = operator; }
public Integer getId() { return id; }
public void setId(Integer id) { this.id = id; }
public int getOrgTypeId() { return orgTypeId; }
public void setOrgTypeId(int orgTypeId) { this.orgTypeId = orgTypeId; }
public Integer getParentOrgId() { return parentOrgId; }
public void setParentOrgId(Integer parentOrgId) { this.parentOrgId = parentOrgId; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public Date getCreationDate() { return creationDate; }
public void setCreationDate(Date creationDate) { this.creationDate = creationDate; }
public Date getUpdateDate() { return updateDate; }
public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; }
public int getOperator() { return operator; }
public void setOperator(int operator) { this.operator = operator; }
public Organization getParentOrganization() { return parentOrganization; }
public void setParentOrganization(Organization parentOrganization) { this.parentOrganization = parentOrganization; }
public Set<Organization> getSubOrganizations() { return subOrganizations; }
public void setSubOrganizations(Set<Organization> subOrganizations) { this.subOrganizations = subOrganizations; }
public OrganizationType getOrgType() { return orgType; }
public void setOrgType(OrganizationType orgType) { this.orgType = orgType; }
public Organization getCompany() { return company; }
public void setCompany(Organization company) { this.company = company; }
public Integer getCompanyId() { return companyId; }
public void setCompanyId(Integer companyId) { this.companyId = companyId; }
@Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; }
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Organization)) { return false; } Organization other = (Organization) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; }
@Override public String toString() { return "org.model.Organization[id=" + id + "]"; } }
|
Когда я пытаюсь высвать setOrgType метод: | Код | newOrg.setOrgType(companyObj);
|
companyObj валидный OrganizationTypeя вылетаю а таким делом: | Код | EJB5018: An exception was thrown during an ejb invocation on [OrganizationBean] javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoSuchMethodError: org.model.Organization._toplink_setorgType(Lorg/config/model/OrganizationType;)V ... Caused by: java.lang.NoSuchMethodError: org.model.Organization._toplink_setorgType(Lorg/config/model/OrganizationType;)V
|
по какой то причине toplink вызывает setorgType а не setОrgType Почему?
--------------------
Если долго мучиться, что нибудь получится... 
|