Getter,Setter etc für SciProject association classes,
SciProjectRepository, SciProjectManager (partly finished)pull/1/head
parent
19ae08b1e4
commit
ea0b9d55ac
|
|
@ -6,9 +6,11 @@
|
||||||
package org.scientificcms.contenttypes.sciproject;
|
package org.scientificcms.contenttypes.sciproject;
|
||||||
|
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
|
import org.libreccm.core.CcmObjects;
|
||||||
import org.librecms.assets.ContactableEntity;
|
import org.librecms.assets.ContactableEntity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
|
@ -28,27 +30,163 @@ import static org.scientificcms.contenttypes.sciproject.SciProjectConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Audited
|
@Audited
|
||||||
@Table(name = "PROJECT_CONTACTS", schema = DB_SCHEMA)
|
@Table(name = "PROJECT_CONTACTS", schema = DB_SCHEMA)
|
||||||
public class Contact implements Serializable{
|
public class Contact implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "CONTACT_ID")
|
@Column(name = "CONTACT_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long contactId;
|
private long contactId;
|
||||||
|
|
||||||
@Column(name = "CONTACT_TYPE", length = 255, nullable = true)
|
@Column(name = "CONTACT_TYPE", length = 255, nullable = true)
|
||||||
private String contactType;
|
private String contactType;
|
||||||
|
|
||||||
@Column(name = "CONTACT_ORDER")
|
@Column(name = "CONTACT_ORDER")
|
||||||
private long order;
|
private long order;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "PROJECT_ID")
|
@JoinColumn(name = "PROJECT_ID")
|
||||||
private SciProject project;
|
private SciProject project;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "CONTACTABLE_ID")
|
@JoinColumn(name = "CONTACTABLE_ID")
|
||||||
private ContactableEntity contactable;
|
private ContactableEntity contactable;
|
||||||
|
|
||||||
|
public long getContactId() {
|
||||||
|
return contactId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactId(final long contactId) {
|
||||||
|
this.contactId = contactId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContactType() {
|
||||||
|
return contactType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactType(final String contactType) {
|
||||||
|
this.contactType = contactType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getOrder() {
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrder(final long order) {
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciProject getProject() {
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setProject(final SciProject project) {
|
||||||
|
this.project = project;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContactableEntity getContactable() {
|
||||||
|
return contactable;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setContactable(final ContactableEntity contactable) {
|
||||||
|
this.contactable = contactable;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 41 * hash + (int) (contactId ^ (contactId >>> 32));
|
||||||
|
hash = 41 * hash + Objects.hashCode(contactType);
|
||||||
|
hash = 41 * hash + (int) (order ^ (order >>> 32));
|
||||||
|
hash = 41 * hash + CcmObjects.hashCodeUsingUuid(project);
|
||||||
|
hash = 41 * hash + CcmObjects.hashCodeUsingUuid(contactable);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(final Object obj) {
|
||||||
|
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof Contact)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final Contact other = (Contact) obj;
|
||||||
|
if (!other.canEqual(this)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (contactId != other.getContactId()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(contactType, other.getContactType())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!CcmObjects.equalsUsingUuid(project, other.getProject())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!CcmObjects.equalsUsingUuid(contactable, other.getContactable())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return order == other.getOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canEqual(final Object obj) {
|
||||||
|
|
||||||
|
return obj instanceof Contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final String toString() {
|
||||||
|
|
||||||
|
return toString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString(final String data) {
|
||||||
|
|
||||||
|
final String projectStr;
|
||||||
|
if (project == null) {
|
||||||
|
projectStr = "";
|
||||||
|
} else {
|
||||||
|
projectStr = String.format("objectId = %d,"
|
||||||
|
+ "uuid = \"%s\", "
|
||||||
|
+ "name = \"%s\"",
|
||||||
|
project.getObjectId(),
|
||||||
|
project.getUuid(),
|
||||||
|
project.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
final String contactableStr;
|
||||||
|
if (contactable == null) {
|
||||||
|
contactableStr = "";
|
||||||
|
} else {
|
||||||
|
contactableStr = String.format("objectId = %d,"
|
||||||
|
+ "uuid = \"%s\", "
|
||||||
|
+ "name = \"%s\"",
|
||||||
|
contactable.getObjectId(),
|
||||||
|
contactable.getUuid(),
|
||||||
|
contactable.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return String.format("%s{ "
|
||||||
|
+ "contactId = %d, "
|
||||||
|
+ "contactType = \"%s\", "
|
||||||
|
+ "order = %d, "
|
||||||
|
+ "project = { %s } "
|
||||||
|
+ "contactableUuid = %s%s"
|
||||||
|
+ " }",
|
||||||
|
super.toString(),
|
||||||
|
contactId,
|
||||||
|
contactType,
|
||||||
|
order,
|
||||||
|
projectStr,
|
||||||
|
contactableStr,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -138,10 +138,7 @@ public class Membership implements Serializable {
|
||||||
if (!CcmObjects.equalsUsingUuid(member, other.getMember())) {
|
if (!CcmObjects.equalsUsingUuid(member, other.getMember())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (status != other.getStatus()) {
|
return status == other.getStatus();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canEqual(final Object obj) {
|
public boolean canEqual(final Object obj) {
|
||||||
|
|
@ -149,4 +146,61 @@ public class Membership implements Serializable {
|
||||||
return obj instanceof Membership;
|
return obj instanceof Membership;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final String toString() {
|
||||||
|
|
||||||
|
return toString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString(final String data) {
|
||||||
|
|
||||||
|
final String projectStr;
|
||||||
|
if (project == null) {
|
||||||
|
projectStr = "";
|
||||||
|
} else {
|
||||||
|
projectStr = String.format("objectId = %d,"
|
||||||
|
+ "uuid = \"%s\", "
|
||||||
|
+ "name = \"%s\"",
|
||||||
|
project.getObjectId(),
|
||||||
|
project.getUuid(),
|
||||||
|
project.getDisplayName());
|
||||||
|
}
|
||||||
|
|
||||||
|
final String memberStr;
|
||||||
|
if (member == null) {
|
||||||
|
memberStr = "";
|
||||||
|
} else {
|
||||||
|
memberStr = String.format("objectId = %d, "
|
||||||
|
+ "uuid = \"%s\", "
|
||||||
|
+ "name = \"%s\", "
|
||||||
|
+ "surname = \"%s\", "
|
||||||
|
+ "givenName = \"%s\", "
|
||||||
|
+ "prefix = \"%s\", "
|
||||||
|
+ "suffix = \"%s\"",
|
||||||
|
member.getObjectId(),
|
||||||
|
member.getUuid(),
|
||||||
|
member.getDisplayName(),
|
||||||
|
member.getPersonName().getSurname(),
|
||||||
|
member.getPersonName().getGivenName(),
|
||||||
|
member.getPersonName().getPrefix(),
|
||||||
|
member.getPersonName().getSuffix());
|
||||||
|
}
|
||||||
|
|
||||||
|
return String.format("%s{ "
|
||||||
|
+ "membershipId = %d, "
|
||||||
|
+ "role = \"%s\", "
|
||||||
|
+ "status = \"%s\","
|
||||||
|
+ "project = { %s }, "
|
||||||
|
+ "member = { %s }%s"
|
||||||
|
+ " }",
|
||||||
|
super.toString(),
|
||||||
|
membershipId,
|
||||||
|
role,
|
||||||
|
Objects.toString(status),
|
||||||
|
projectStr,
|
||||||
|
memberStr,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import javax.persistence.Entity;
|
||||||
|
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
import org.libreccm.l10n.LocalizedString;
|
import org.libreccm.l10n.LocalizedString;
|
||||||
import org.librecms.assets.Person;
|
|
||||||
import org.librecms.contentsection.ContentItem;
|
import org.librecms.contentsection.ContentItem;
|
||||||
import org.librecms.contenttypes.AuthoringKit;
|
import org.librecms.contenttypes.AuthoringKit;
|
||||||
import org.librecms.contenttypes.AuthoringStep;
|
import org.librecms.contenttypes.AuthoringStep;
|
||||||
|
|
@ -20,13 +19,18 @@ import org.librecms.contenttypes.ContentTypeDescription;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.AssociationOverride;
|
import javax.persistence.AssociationOverride;
|
||||||
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Embedded;
|
import javax.persistence.Embedded;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
|
import javax.persistence.NamedQueries;
|
||||||
|
import javax.persistence.NamedQuery;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
|
@ -55,6 +59,37 @@ import static org.scientificcms.contenttypes.sciproject.SciProjectConstants.*;
|
||||||
+ ".description",
|
+ ".description",
|
||||||
order = 1)
|
order = 1)
|
||||||
})
|
})
|
||||||
|
@NamedQueries({
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findWhereBeginIsBefore",
|
||||||
|
query = "SELECT p FROM SciProject p WHERE p.begin < :date"
|
||||||
|
),
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findWhereBeginIs",
|
||||||
|
query = "SELECT p FROM SciProject p WHERE p.begin = :date"
|
||||||
|
),
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findWhereBeginIsAfter",
|
||||||
|
query = "SELECT p FROM SciProject p WHERE p.begin > :date"
|
||||||
|
),
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findWhereEndIsBefore",
|
||||||
|
query = "SELECT p FROM SciProject p WHERE p.end < :date"
|
||||||
|
),
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findWhereEndIs",
|
||||||
|
query = "SELECT p FROM SciProject p WHERE p.end = :date"
|
||||||
|
),
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findWhereEndIsAfter",
|
||||||
|
query = "SELECT p FROM SciProject p WHERE p.end > :date"
|
||||||
|
),
|
||||||
|
@NamedQuery(
|
||||||
|
name = "SciProject.findByMember",
|
||||||
|
query = "SELECT p FROM SciProject p JOIN Membership m "
|
||||||
|
+ "WHERE m.member = :member"
|
||||||
|
)
|
||||||
|
})
|
||||||
public class SciProject extends ContentItem implements Serializable {
|
public class SciProject extends ContentItem implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -85,7 +120,7 @@ public class SciProject extends ContentItem implements Serializable {
|
||||||
@JoinColumn(name = "OBJECT_ID")
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
private LocalizedString description;
|
private LocalizedString projectDescription;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
|
|
@ -108,11 +143,91 @@ public class SciProject extends ContentItem implements Serializable {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
private LocalizedString fundingVolume;
|
private LocalizedString fundingVolume;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "project")
|
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL)
|
||||||
private List<Contact> contacts;
|
private List<Contact> contacts;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "project")
|
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL)
|
||||||
private List<Membership> members;
|
private List<Membership> members;
|
||||||
|
|
||||||
|
public LocalDate getBegin() {
|
||||||
|
return begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBegin(final LocalDate begin) {
|
||||||
|
this.begin = begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getEnd() {
|
||||||
|
return end;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnd(final LocalDate end) {
|
||||||
|
this.end = end;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalizedString getShortDescription() {
|
||||||
|
return shortDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShortDescription(final LocalizedString shortDescription) {
|
||||||
|
this.shortDescription = shortDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalizedString getProjectDescription() {
|
||||||
|
return projectDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectDescription(final LocalizedString projectDescription) {
|
||||||
|
this.projectDescription = projectDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalizedString getFunding() {
|
||||||
|
return funding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFunding(final LocalizedString funding) {
|
||||||
|
this.funding = funding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalizedString getFundingVolume() {
|
||||||
|
return fundingVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFundingVolume(final LocalizedString fundingVolume) {
|
||||||
|
this.fundingVolume = fundingVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Contact> getContacts() {
|
||||||
|
return Collections.unmodifiableList(contacts);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addContact(final Contact contact) {
|
||||||
|
contacts.add(contact);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void removeContact(final Contact contact) {
|
||||||
|
contacts.remove(contact);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setContacts(final List<Contact> contacts) {
|
||||||
|
this.contacts = new ArrayList<>(contacts);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Membership> getMembers() {
|
||||||
|
return Collections.unmodifiableList(members);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addMember(final Membership membership) {
|
||||||
|
members.add(membership);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void removeMembership(final Membership membership) {
|
||||||
|
members.remove(membership);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setMembers(final List<Membership> members) {
|
||||||
|
this.members = new ArrayList<>(members);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.scientificcms.contenttypes.sciproject;
|
||||||
|
|
||||||
|
import org.librecms.assets.ContactableEntity;
|
||||||
|
import org.librecms.assets.Person;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
public class SciProjectMananger implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private SciProjectRepository sciProjectRepository;
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public void addcontact(final ContactableEntity contactable,
|
||||||
|
final SciProject toProject,
|
||||||
|
final String withType) {
|
||||||
|
|
||||||
|
Objects.requireNonNull(contactable,
|
||||||
|
"Can't null as Contact to a SciProject.");
|
||||||
|
Objects.requireNonNull(toProject,
|
||||||
|
"Can't add a Contact to a project null.");
|
||||||
|
|
||||||
|
final Contact contact = new Contact();
|
||||||
|
contact.setContactable(contactable);
|
||||||
|
contact.setProject(toProject);
|
||||||
|
contact.setContactType(withType);
|
||||||
|
contact.setOrder(toProject.getContacts().size());
|
||||||
|
|
||||||
|
toProject.addContact(contact);
|
||||||
|
|
||||||
|
sciProjectRepository.save(toProject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public void addMember(final Person person,
|
||||||
|
final SciProject toProject,
|
||||||
|
final String withRole,
|
||||||
|
final MembershipStatus withStatus) {
|
||||||
|
|
||||||
|
throw new UnsupportedOperationException("ToDo");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.scientificcms.contenttypes.sciproject;
|
||||||
|
|
||||||
|
import org.librecms.assets.Person;
|
||||||
|
import org.librecms.contentsection.ContentItemRepository;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
public class SciProjectRepository extends ContentItemRepository {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findWhereBeginIsBefore(final LocalDate date) {
|
||||||
|
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findWhereBeginIsBefore",
|
||||||
|
SciProject.class)
|
||||||
|
.setParameter("date", date)
|
||||||
|
.getResultList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findWhereBeginIs(final LocalDate date) {
|
||||||
|
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findWhereBeginIs", SciProject.class)
|
||||||
|
.setParameter("date", date)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findWhereBeginIsAfter(final LocalDate date) {
|
||||||
|
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findWhereBeginIsAfter",
|
||||||
|
SciProject.class)
|
||||||
|
.setParameter("date", date)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findWhereEndIsBefore(final LocalDate date) {
|
||||||
|
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findWhereEndIsBefore",
|
||||||
|
SciProject.class)
|
||||||
|
.setParameter("date", date)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findWhereEndIs(final LocalDate date) {
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findWhereEndIs",
|
||||||
|
SciProject.class)
|
||||||
|
.setParameter("date", date)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findWhereEndIsAfter(final LocalDate date) {
|
||||||
|
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findWhereEndIsAfter",
|
||||||
|
SciProject.class)
|
||||||
|
.setParameter("date", date)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public List<SciProject> findByMember(final Person member) {
|
||||||
|
|
||||||
|
return getEntityManager()
|
||||||
|
.createNamedQuery("SciProject.findByMember", SciProject.class)
|
||||||
|
.setParameter("member", member)
|
||||||
|
.getResultList();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue