use of org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType in project estatio by estatio.
the class LeaseBuilder method createAddress.
private void createAddress(Lease lease, IAgreementRoleCommunicationChannelType addressType) {
final AgreementRoleType agreementRoleType = agreementRoleTypeRepository.find(LeaseAgreementRoleTypeEnum.TENANT);
final AgreementRole agreementRole = lease.findRoleWithType(agreementRoleType, ld(2010, 7, 15));
AgreementRoleCommunicationChannelType agreementRoleCommunicationChannelType = agreementRoleCommunicationChannelTypeRepository.find(addressType);
final SortedSet<CommunicationChannel> channels = communicationChannelRepository.findByOwnerAndType(lease.getSecondaryParty(), CommunicationChannelType.POSTAL_ADDRESS);
final CommunicationChannel postalAddress = channels.first();
agreementRole.addCommunicationChannel(agreementRoleCommunicationChannelType, postalAddress, null);
}
use of org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType in project estatio by estatio.
the class AgreementRoleCommunicationChannelTypeRepository method findOrCreate.
public AgreementRoleCommunicationChannelType findOrCreate(final IAgreementRoleCommunicationChannelType data, final IAgreementType IAgreementType) {
final String title = data.getTitle();
final AgreementType agreementType = agreementTypeRepository.findOrCreate(IAgreementType);
AgreementRoleCommunicationChannelType arcct = findByAgreementTypeAndTitle(agreementType, title);
if (arcct == null) {
arcct = getContainer().newTransientInstance(AgreementRoleCommunicationChannelType.class);
arcct.setTitle(title);
arcct.setAppliesTo(agreementType);
getContainer().persist(arcct);
}
return arcct;
}
Aggregations