package fi.otavanopisto.muikku.model.base; import javax.persistence.Cacheable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.validation.constraints.NotNull; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.validator.constraints.NotEmpty; @Entity @Cacheable (true) @Cache (usage = CacheConcurrencyStrategy.TRANSACTIONAL) public class SchoolDataSource { public Long getId() { return id; } public String getIdentifier() { return identifier; } public void setIdentifier(String identifier) { this.identifier = identifier; } @Id @GeneratedValue (strategy = GenerationType.IDENTITY) private Long id; @NotEmpty @NotNull @Column (nullable = false, unique = true) private String identifier; }