feature/add-jenkinsfile #114

Merged
hsh-michaelhoennig merged 5 commits from feature/add-jenkinsfile into master 2024-10-14 10:36:58 +02:00
2 changed files with 7 additions and 41 deletions
Showing only changes of commit 92525ab45a - Show all commits

View File

@ -54,14 +54,10 @@ public class HsOfficeRelationController implements HsOfficeRelationsApi {
context.define(currentSubject, assumedRoles);
final List<HsOfficeRelationRbacEntity> entities =
( personData == null && contactData == null )
? relationRbacRepo.findRelationRelatedToPersonUuidRelationTypePersonAndContactData(personUuid,
relationRbacRepo.findRelationRelatedToPersonUuidRelationTypePersonAndContactData(
personUuid,
relationType == null ? null : HsOfficeRelationType.valueOf(relationType.name()),
personData, contactData)
: relationRbacRepo.findRelationRelatedToPersonUuidRelationTypePersonAndContactData(
personUuid,
relationType == null ? null : HsOfficeRelationType.valueOf(relationType.name()),
forLike(personData), forLike(contactData));
personData, contactData);
final var resources = mapper.mapList(entities, HsOfficeRelationResource.class,
RELATION_ENTITY_TO_RESOURCE_POSTMAPPER);

View File

@ -28,10 +28,10 @@ public interface HsOfficeRelationRbacRepository extends Repository<HsOfficeRelat
* @return a list of (accessible) relations which match all given criteria
*/
default List<HsOfficeRelationRbacEntity> findRelationRelatedToPersonUuidRelationTypePersonAndContactData(
UUID personUuid,
HsOfficeRelationType relationType,
String personData,
String contactData) {
final UUID personUuid,
final HsOfficeRelationType relationType,
final String personData,
final String contactData) {
return findRelationRelatedToPersonUuidRelationTypePersonAndContactDataImpl(
personUuid, toStringOrNull(relationType), toSqlLikeOperand(personData), toSqlLikeOperand(contactData));
}
@ -57,36 +57,6 @@ public interface HsOfficeRelationRbacRepository extends Repository<HsOfficeRelat
final String personData,
final String contactData);
/**
* Finds relations by a conjunction of optional criteria, including anchorPerson, holderPerson and contact data.
*
* @param personUuid the optional UUID of the anchorPerson or holderPerson
* @param relationType the type of the relation
* @param personData a lower-case string to match the persons tradeName, familyName or givenName (use '%' for wildcard)
* @param contactData a lower-case string to match the contacts caption, postalAddress, emailAddresses or phoneNumbers (use '%' for wildcard)
* @return a list of (accessible) relations which match all given criteria
*/
@Query(value = """
SELECT rel FROM HsOfficeRelationRbacEntity AS rel
WHERE (:relationType IS NULL OR CAST(rel.type AS String) = CAST(:relationType AS String))
AND ( :personUuid IS NULL OR
rel.anchor.uuid = :personUuid OR rel.holder.uuid = :personUuid )
AND ( :personData IS NULL OR
lower(rel.anchor.tradeName) LIKE :personData OR lower(rel.holder.tradeName) LIKE :personData OR
lower(rel.anchor.familyName) LIKE :personData OR lower(rel.holder.familyName) LIKE :personData OR
lower(rel.anchor.givenName) LIKE :personData OR lower(rel.holder.givenName) LIKE :personData )
AND ( :contactData IS NULL OR
lower(rel.contact.caption) LIKE :contactData OR
lower(rel.contact.postalAddress) LIKE :contactData OR
lower(CAST(rel.contact.emailAddresses AS String)) LIKE :contactData OR
lower(CAST(rel.contact.phoneNumbers AS String)) LIKE :contactData )
""")
List<HsOfficeRelationRbacEntity> findRelationRelatedToPersonUuidRelationTypePersonAndContactData(
UUID personUuid,
HsOfficeRelationType relationType,
String personData,
String contactData);
HsOfficeRelationRbacEntity save(final HsOfficeRelationRbacEntity entity);
long count();