Hi,
I have attached the Relationship, RelationshipRoleType, LegalEntity entities.
Code:
@Entity
@Table(name = "LEGAL_ENTITY")
public class LegalEntity extends BaseModel {
private static final long serialVersionUID = -1026643587757325475L;
@Id
@Column(name = "LEGAL_ENTITY_ID", unique = true, nullable = false)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="LegalSeqGenerator")
@SequenceGenerator(name="LegalSeqGenerator", sequenceName="LEGAL_ENTITY_SEQ")
private Long legalEntityId;
@Column(name = "CRED_LEI")
private Long credLeId;
@Column(name = "LEI")
private String lei;
@Column(name = "LEI_SOURCE")
private String leiSource;
@Column(name = "AVID")
private BigDecimal avid;
@Column(name = "GIIN")
private String giin;
@Column(name = "ENTITY_LEGAL_NAME", nullable = false)
private String entityLegalName;
@Column(name = "SOURCE_TYPE_CD", nullable = false)
private String sourceTypeCd;
@Column(name = "SOURCE_ID")
private Long sourceId;
@Column(name = "URL")
private String URL;
/*@Column(name = "PRIMARY_BUSINESS_PURPOSE_CD", nullable = false)
private String primaryBusinessPurposeCd;*/
@OneToOne
@JoinColumn(name="PRIMARY_BUSINESS_PURPOSE_CD")
private BusinessPurposeData businessPurpose;
public BusinessPurposeData getBusinessPurpose() {
return businessPurpose;
}
public void setBusinessPurpose(BusinessPurposeData businessPurpose) {
this.businessPurpose = businessPurpose;
}
@OneToOne
@JoinColumn(name="LEGAL_STRUCTURE_ID")
private LegalStructure legalStructure;
@Transient
private BigDecimal leEntityHistId;
public LegalStructure getLegalStructure() {
return legalStructure;
}
public void setLegalStructure(LegalStructure legalStructure) {
this.legalStructure = legalStructure;
}
@OneToOne
@JoinColumn(name="GLOBAL_STRUCTURE_ID",insertable = false,updatable = false)
private LegalStructure globalStructure;
public LegalStructure getGlobalStructure() {
return globalStructure;
}
public void setGlobalStructure(LegalStructure globalStructure) {
this.globalStructure = globalStructure;
}
public LegalEntityTax getLegalEntityTax() {
return legalEntityTax;
}
public void setLegalEntityTax(LegalEntityTax legalEntityTax) {
this.legalEntityTax = legalEntityTax;
}
@Column(name = "FORMATION_STATUS_CD", nullable = false)
private String formationStatusCd;
@Column(name = "CONSORTIUM_STATUS_CD", nullable = false)
private String consortiumStatus;
@Column(name="CRED_RISK_RATING")
private String credRiskRating;
@Column(name="BASE_LEGAL_ENTITY_ID")
private Long baseLegalEntityId;
@Column(name="ANGLECIZED_LEGAL_NAME")
private String anglecizedLegalName;
@Transient
private List<LegalEntityAddress> legalEntityAdresses;
@Transient
private LeClassificationFetch leClassification;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private Set<LegalEntityOtherName> othernames = new HashSet<LegalEntityOtherName>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private Set<LegalEntityExchange> exchangeList = new HashSet<LegalEntityExchange>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private Set<LeRegulatoryListing> regulatoryListing = new HashSet<LeRegulatoryListing>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private Set<LegalEntityIdentity> legalEntityIdentities = new HashSet<LegalEntityIdentity>();
@OneToOne(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private LegalEntityTax legalEntityTax;
@OneToOne(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private LeIndividual leIndividual;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "legalEntity")
private Set<Provider> providers = new HashSet<Provider>();
public Set<LegalEntityExchange> getExchangeList() {
return exchangeList;
}
public void setExchangeList(Set<LegalEntityExchange> exchangeList) {
this.exchangeList = exchangeList;
}
public Set<LeRegulatoryListing> getRegulatoryListing() {
return regulatoryListing;
}
public void setRegulatoryListing(Set<LeRegulatoryListing> regulatoryListing) {
this.regulatoryListing = regulatoryListing;
}
public Set<LegalEntityIdentity> getLegalEntityIdentities() {
return legalEntityIdentities;
}
public Set<LegalEntityOtherName> getOthernames() {
return othernames;
}
public void setOthernames(Set<LegalEntityOtherName> othernames) {
this.othernames = othernames;
}
public void setLegalEntityIdentities(
Set<LegalEntityIdentity> legalEntityIdentities) {
this.legalEntityIdentities = legalEntityIdentities;
}
public LegalEntity() {
}
public Long getLegalEntityId() {
return legalEntityId;
}
public void setLegalEntityId(Long legalEntityId) {
this.legalEntityId = legalEntityId;
}
public String getEntityLegalName() {
return entityLegalName;
}
public void setEntityLegalName(String entityLegalName) {
this.entityLegalName = entityLegalName;
}
public String getSourceTypeCd() {
return sourceTypeCd;
}
public void setSourceTypeCd(String sourceTypeCd) {
this.sourceTypeCd = sourceTypeCd;
}
public Long getSourceId() {
return sourceId;
}
public void setSourceId(Long sourceId) {
this.sourceId = sourceId;
}
public String getCredRiskRating() {
return credRiskRating;
}
public void setCredRiskRating(String credRiskRating) {
this.credRiskRating = credRiskRating;
}
public String getURL() {
return URL;
}
public void setURL(String uRL) {
URL = uRL;
}
public String getFormationStatusCd() {
return formationStatusCd;
}
public void setFormationStatusCd(String formationStatusCd) {
this.formationStatusCd = formationStatusCd;
}
public String getConsortiumStatus() {
return consortiumStatus;
}
public void setConsortiumStatus(String consortiumStatus) {
this.consortiumStatus = consortiumStatus;
}
public Long getBaseLegalEntityId() {
return baseLegalEntityId;
}
public void setBaseLegalEntityId(Long baseLegalEntityId) {
this.baseLegalEntityId = baseLegalEntityId;
}
public String getAnglecizedLegalName() {
return anglecizedLegalName;
}
public void setAnglecizedLegalName(String anglecizedLegalName) {
this.anglecizedLegalName = anglecizedLegalName;
}
public Long getCredLeId() {
return credLeId;
}
public void setCredLeId(Long credLeId) {
this.credLeId = credLeId;
}
public List<LegalEntityAddress> getLegalEntityAdresses() {
return legalEntityAdresses;
}
public void setLegalEntityAdresses(List<LegalEntityAddress> legalEntityAdresses) {
this.legalEntityAdresses = legalEntityAdresses;
}
public LegalEntityTax getLeTax() {
return this.legalEntityTax;
}
/**
* @return the lei
*/
public String getLei() {
return lei;
}
/**
* @param lei the lei to set
*/
public void setLei(String lei) {
this.lei = lei;
}
/**
* @return the leiSource
*/
public String getLeiSource() {
return leiSource;
}
/**
* @param leiSource the leiSource to set
*/
public void setLeiSource(String leiSource) {
this.leiSource = leiSource;
}
/**
* @return the avid
*/
public BigDecimal getAvid() {
return avid;
}
/**
* @param avid the avid to set
*/
public void setAvid(BigDecimal avid) {
this.avid = avid;
}
/**
* @return the giin
*/
public String getGiin() {
return giin;
}
/**
* @param giin the giin to set
*/
public void setGiin(String giin) {
this.giin = giin;
}
public void setLeTax(LegalEntityTax legalEntityTax) {
this.legalEntityTax = legalEntityTax;
}
public Set<Provider> getProviders() {
return this.providers;
}
public void setProviders(Set<Provider> providers) {
this.providers = providers;
}
public LeClassificationFetch getLeClassification() {
return leClassification;
}
public void setLeClassification(LeClassificationFetch leClassification) {
this.leClassification = leClassification;
}
public BigDecimal getLeEntityHistId() {
return leEntityHistId;
}
public void setLeEntityHistId(BigDecimal leEntityHistId) {
this.leEntityHistId = leEntityHistId;
}
/**
* @return the leIndividual
*/
public LeIndividual getLeIndividual() {
return leIndividual;
}
/**
* @param leIndividual the leIndividual to set
*/
public void setLeIndividual(LeIndividual leIndividual) {
this.leIndividual = leIndividual;
}
}
Code:
@Entity
@Table(name = "RELATIONSHIP_ROLE_TYPE", schema = "CRED_MDM")
public class RelationshipRoleType implements java.io.Serializable {
private String relationshipRoleCd;
private String relationshipRoleDesc;
private String activeInd;
private String updateUser;
private Date updateDate;
private Set<RelationshipRole> relationshipRoles = new HashSet<RelationshipRole>(
0);
public RelationshipRoleType() {
}
public RelationshipRoleType(String relationshipRoleCd,
String relationshipRoleDesc, String activeInd, String updateUser,
Date updateDate) {
this.relationshipRoleCd = relationshipRoleCd;
this.relationshipRoleDesc = relationshipRoleDesc;
this.activeInd = activeInd;
this.updateUser = updateUser;
this.updateDate = updateDate;
}
public RelationshipRoleType(String relationshipRoleCd,
String relationshipRoleDesc, String activeInd, String updateUser,
Date updateDate, Set<RelationshipRole> relationshipRoles) {
this.relationshipRoleCd = relationshipRoleCd;
this.relationshipRoleDesc = relationshipRoleDesc;
this.activeInd = activeInd;
this.updateUser = updateUser;
this.updateDate = updateDate;
this.relationshipRoles = relationshipRoles;
}
@Id
@Column(name = "RELATIONSHIP_ROLE_CD", unique = true, nullable = false, length = 15)
public String getRelationshipRoleCd() {
return this.relationshipRoleCd;
}
public void setRelationshipRoleCd(String relationshipRoleCd) {
this.relationshipRoleCd = relationshipRoleCd;
}
@Column(name = "RELATIONSHIP_ROLE_DESC", nullable = false, length = 100)
public String getRelationshipRoleDesc() {
return this.relationshipRoleDesc;
}
public void setRelationshipRoleDesc(String relationshipRoleDesc) {
this.relationshipRoleDesc = relationshipRoleDesc;
}
@Column(name = "ACTIVE_IND", nullable = false, length = 1)
public String getActiveInd() {
return this.activeInd;
}
public void setActiveInd(String activeInd) {
this.activeInd = activeInd;
}
@Column(name = "UPDATE_USER", nullable = false, length = 20)
public String getUpdateUser() {
return this.updateUser;
}
public void setUpdateUser(String updateUser) {
this.updateUser = updateUser;
}
@Temporal(TemporalType.DATE)
@Column(name = "UPDATE_DATE", nullable = false, length = 7)
public Date getUpdateDate() {
return this.updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "relationshipRoleType")
public Set<RelationshipRole> getRelationshipRoles() {
return this.relationshipRoles;
}
public void setRelationshipRoles(Set<RelationshipRole> relationshipRoles) {
this.relationshipRoles = relationshipRoles;
}
}
Code:
@Entity
@Table(name = "RELATIONSHIP")
public class Relationship implements java.io.Serializable {
private static final long serialVersionUID = -8053796894520890075L;
private BigDecimal relationshipId;
private RelationshipType relationshipType;
private Date startDate;
private Date endDate;
private String activeInd;
private String updateUser;
private Date updateDate;
private BigDecimal sourceId;
private Long relationshipStatusId;
private Set<RelationshipRole> relationshipRolesForRelationshipId = new HashSet<RelationshipRole>(
0);
private Set<RelationshipRole> relationshipRolesForRelatedRelationshipId = new HashSet<RelationshipRole>(
0);
private Set<Permission> permissions = new HashSet<Permission>(0);
private Set<EvidenceSource> evidenceSources = new HashSet<EvidenceSource>(0);
public Relationship() {
}
public Relationship(BigDecimal relationshipId,
RelationshipType relationshipType, Date startDate,
String activeInd, String updateUser, Date updateDate) {
this.relationshipId = relationshipId;
this.relationshipType = relationshipType;
this.startDate = startDate;
this.activeInd = activeInd;
this.updateUser = updateUser;
this.updateDate = updateDate;
}
public Relationship(BigDecimal relationshipId,
RelationshipType relationshipType, Date startDate, Date endDate,
String activeInd, String updateUser, Date updateDate,
BigDecimal sourceId,
Set<RelationshipRole> relationshipRolesForRelationshipId,
Set<RelationshipRole> relationshipRolesForRelatedRelationshipId,
Set<Permission> permissions) {
this.relationshipId = relationshipId;
this.relationshipType = relationshipType;
this.startDate = startDate;
this.endDate = endDate;
this.activeInd = activeInd;
this.updateUser = updateUser;
this.updateDate = updateDate;
this.sourceId = sourceId;
this.relationshipRolesForRelationshipId = relationshipRolesForRelationshipId;
this.relationshipRolesForRelatedRelationshipId = relationshipRolesForRelatedRelationshipId;
this.permissions = permissions;
}
@Id
@Column(name = "RELATIONSHIP_ID", unique = true, nullable = false, precision = 22, scale = 0)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="RelSeqGenerator")
@SequenceGenerator(name="RelSeqGenerator", sequenceName="RELATIONSHIP_SEQ")
public BigDecimal getRelationshipId() {
return this.relationshipId;
}
public void setRelationshipId(BigDecimal relationshipId) {
this.relationshipId = relationshipId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "RELATIONSHIP_TYPE_CD", nullable = false)
public RelationshipType getRelationshipType() {
return this.relationshipType;
}
public void setRelationshipType(RelationshipType relationshipType) {
this.relationshipType = relationshipType;
}
@Temporal(TemporalType.DATE)
@Column(name = "START_DATE", nullable = false, length = 7)
public Date getStartDate() {
return this.startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
@Temporal(TemporalType.DATE)
@Column(name = "END_DATE", length = 7)
public Date getEndDate() {
return this.endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Column(name = "ACTIVE_IND", nullable = false, length = 1)
public String getActiveInd() {
return this.activeInd;
}
public void setActiveInd(String activeInd) {
this.activeInd = activeInd;
}
@Column(name = "UPDATE_USER", nullable = false, length = 20)
public String getUpdateUser() {
return this.updateUser;
}
public void setUpdateUser(String updateUser) {
this.updateUser = updateUser;
}
@Temporal(TemporalType.DATE)
@Column(name = "UPDATE_DATE", nullable = false, length = 7)
public Date getUpdateDate() {
return this.updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
@Column(name = "SOURCE_ID", precision = 22, scale = 0)
public BigDecimal getSourceId() {
return this.sourceId;
}
public void setSourceId(BigDecimal sourceId) {
this.sourceId = sourceId;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "relationshipByRelationshipId")
public Set<RelationshipRole> getRelationshipRolesForRelationshipId() {
return this.relationshipRolesForRelationshipId;
}
public void setRelationshipRolesForRelationshipId(
Set<RelationshipRole> relationshipRolesForRelationshipId) {
this.relationshipRolesForRelationshipId = relationshipRolesForRelationshipId;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "relationshipByRelatedRelationshipId")
public Set<RelationshipRole> getRelationshipRolesForRelatedRelationshipId() {
return this.relationshipRolesForRelatedRelationshipId;
}
public void setRelationshipRolesForRelatedRelationshipId(
Set<RelationshipRole> relationshipRolesForRelatedRelationshipId) {
this.relationshipRolesForRelatedRelationshipId = relationshipRolesForRelatedRelationshipId;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "relationship")
public Set<Permission> getPermissions() {
return this.permissions;
}
public void setPermissions(Set<Permission> permissions) {
this.permissions = permissions;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "relationship")
public Set<EvidenceSource> getEvidenceSources() {
return this.evidenceSources;
}
public void setEvidenceSources(Set<EvidenceSource> evidenceSources) {
this.evidenceSources = evidenceSources;
}
@Column(name = "RELATIONSHIP_STATUS_ID")
public Long getRelationshipStatusId() {
return relationshipStatusId;
}
public void setRelationshipStatusId(Long relationshipStatusId) {
this.relationshipStatusId = relationshipStatusId;
}
}