@Produces(MediaType.APPLICATION_JSON)
public Collection<ContributorEntity> search(@QueryParam("release") String release, @QueryParam("work") String work, @QueryParam("recording") String recording, @QueryParam("recordingSession") String recordingSession, @QueryParam("artist") String artist, @QueryParam("owner") String owner) {
try {
transactionManager.begin();
if (owner!=null) {
SMDIdentityReference reference = smdIdentityReferenceRepository.findById(owner);
if(reference==null) {
return new ArrayList<ContributorEntity>();
}
if(reference.getType().equals(SMDIdentityReferenceEntity.typeForClass(ReleaseEntity.class))) {
release = owner;
}else if(reference.getType().equals(SMDIdentityReferenceEntity.typeForClass(WorkEntity.class))) {
work = owner;
}else if(reference.getType().equals(SMDIdentityReferenceEntity.typeForClass(RecordingEntity.class))) {
recording = owner;
}else if(reference.getType().equals(SMDIdentityReferenceEntity.typeForClass(RecordingSessionEntity.class))) {
recordingSession = owner;
}else {
return new ArrayList<ContributorEntity>();
}
}