@OneToOne(fetch = FetchType.LAZY,optional = true)
@JoinColumn(name = "attribute_group_id", nullable = true)
private AttributeGroup attributeGroup;
- @Column(name = "profile_id", nullable = true)
- private Long profileId;
+ @OneToOne(fetch = FetchType.LAZY, optional = true)
+ @JoinColumn(name = "profile_id", nullable = true)
+ private Profile profile;
@Column(name = "locked")
private boolean locked;
@Column(name = "lock_owner")
this.attributeGroup = attributeGroup;
}
- public long getProfileId() {
- return profileId;
+ public Profile getProfile() {
+ return profile;
}
- public void setProfileId(long profileId) {
- this.profileId = profileId;
+ public void setProfile(Profile profile) {
+ this.profile = profile;
}
public boolean isLocked() {
s.name = sto.getName();
s.updateDate = sto.getUpdateDate();
s.valid = sto.getValid();
- s.profileId = sto.getProfileId() == 0 ? null : sto.getProfileId();
+ s.profile = sto.getProfileId() == 0 ? null : em.find(Profile.class,sto.getProfileId());
s.locked = sto.isLocked();
s.lockOwner = sto.getLockOwner() == 0 ? null : sto.getLockOwner();
return s;
sto.setName(this.name);
sto.setUpdateDate(this.updateDate);
sto.setValid(this.valid);
- sto.setProfileId(this.profileId == null ? 0 : this.profileId);
+ sto.setProfileId(this.profile == null ? 0 : this.profile.getId());
sto.setLocked(this.locked);
sto.setLockOwner(this.lockOwner == null ? 0 : this.lockOwner);
return sto;
hash = 67 * hash + (this.valid ? 1 : 0);
hash = 67 * hash + (this.deleted ? 1 : 0);
hash = 67 * hash + Objects.hashCode(this.deletionDate);
- hash = 67 * hash + Objects.hashCode(this.profileId);
hash = 67 * hash + (this.locked ? 1 : 0);
return hash;
}