Skip to content

Commit

Permalink
Merge pull request #319 from europeana/EA-3721-3791_organization_inde…
Browse files Browse the repository at this point in the history
…xing

Ea 3721 3791 organization indexing
  • Loading branch information
gsergiu authored Apr 3, 2024
2 parents 684b5e2 + bb8730e commit 20e8c5e
Show file tree
Hide file tree
Showing 41 changed files with 705 additions and 602 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class FailedTask {

private Instant modified;

private FailedTask() {
// default constructor
FailedTask() {
// default constructor used by morphia
}

public FailedTask(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public class Organization extends Entity {
private String countryId;
@Transient
private Place country;
@Transient
private String countryISO;


private List<String> europeanaRoleIds;
@Reference(lazy = true)
Expand Down Expand Up @@ -280,10 +283,8 @@ public Place getCountry() {
if(country == null && getCountryId() != null) {
//set country if not dereferenced during retrieval from database
country = new Place(getCountryId());
}else if(country != null) {
//reset context to remove it from serialization
country.setContext(null);
}
}

return country;
}

Expand Down Expand Up @@ -336,4 +337,13 @@ public List<Vocabulary> getEuropeanaRole() {
public void setEuropeanaRole(List<Vocabulary> europeanaRole) {
this.europeanaRole = europeanaRole;
}

@JsonIgnore
public String getCountryISO() {
return countryISO;
}

public void setCountryISO(String countryISO) {
this.countryISO = countryISO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ int compareClass(Object e1, Object e2) {
return 0;
}

@SuppressWarnings("unchecked")
int compareContent(Entity e1, Entity e2) throws IllegalAccessException {

List<Field> allObjectFieldsE1 = EntityUtils.getAllFields(e1.getClass());
Expand All @@ -74,6 +73,7 @@ int compareContent(Entity e1, Entity e2) throws IllegalAccessException {
return 0;
}

@SuppressWarnings("unchecked")
private int compareEntityField(Entity e1, Entity e2, Field field) throws IllegalAccessException {
Class<?> fieldType = field.getType();

Expand Down Expand Up @@ -148,7 +148,6 @@ private int compareLists(List<Object> l1, List<Object> l2) {
return 0;
}

@SuppressWarnings("unchecked")
private int compareMaps(Map<Object, Object> m1, Map<Object, Object> m2) {
if (MapUtils.isEmpty(m1) && MapUtils.isEmpty(m2)) {
// if both null or empty
Expand All @@ -166,6 +165,7 @@ private int compareMaps(Map<Object, Object> m1, Map<Object, Object> m2) {
return getMapResults(m1, m2);
}

@SuppressWarnings("unchecked")
private int getMapResults(Map<Object, Object> m1, Map<Object, Object> m2) {
for (Map.Entry<Object, Object> m1Elem : m1.entrySet()) {
if (m2.containsKey(m1Elem.getKey())) {
Expand Down
Loading

0 comments on commit 20e8c5e

Please sign in to comment.