Commit 68c2867c authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

add methods in the model

parent d0718700
Loading
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -41,6 +41,39 @@ public class GeographicSite extends BaseRootEntity {
    @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
    private Set<RelatedParty> relatedParties = new HashSet<>();

    public GeographicSite addCalendarPeriod(CalendarPeriod calendarPeriod){
        if(this.calendar==null){
            this.calendar=new HashSet<>();
        }
        this.calendar.add(calendarPeriod);
        return this;
    }

    public GeographicSite addPlaceRefOrValue(PlaceRefOrValue placeRefOrValue){
        if(this.placeRefOrValue==null){
            this.placeRefOrValue=new HashSet<>();
        }
        this.placeRefOrValue.add(placeRefOrValue);
        return this;
    }

    public GeographicSite addGeographicSiteRelationship(GeographicSiteRelationship geographicSiteRelationship){
        if (this.geographicSiteRelationship==null){
            this.geographicSiteRelationship=new HashSet<>();

        }
        this.geographicSiteRelationship.add(geographicSiteRelationship);
        return this;
    }

    public GeographicSite addRelatedParty(RelatedParty relatedParty){
        if(this.relatedParties==null){
            this.relatedParties=new HashSet<>();
        }
        this.relatedParties.add(relatedParty);
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;