19 package org.turro.elephant.entities.db;
21 import java.util.Collection;
22 import java.util.Date;
23 import javax.persistence.Entity;
24 import javax.persistence.Id;
25 import javax.persistence.Temporal;
26 import org.turro.string.Strings;
27 import org.turro.assistant.Assistant;
28 import org.turro.assistant.AssistantConstants;
29 import org.turro.assistant.AssistantSet;
30 import org.turro.assistant.Assistants;
31 import org.turro.elephant.db.ElephantPU;
32 import org.turro.elephant.db.WhereClause;
33 import org.turro.entities.Entities;
34 import org.turro.jpa.Dao;
35 import org.turro.plugin.contacts.IContact;
42 public class Sendable implements java.io.Serializable {
45 private String entityPath;
47 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
48 private java.util.Date schedule;
57 this.entityPath = entityPath;
65 this.schedule = schedule;
79 return Strings.isBlank(entityPath) || schedule ==
null;
97 if(contact !=
null && contact.
isWebUser()) {
109 wc.
addClause(
"select sa from SendableAssistant sa");
110 wc.
addClause(
"where sa.entityPath = :path");
113 wc.
addClause(
"and sa.delivered = FALSE");
115 return dao.getResultList(wc);
121 wc.
addClause(
"delete from SendableAssistant sa");
122 wc.
addClause(
"where sa.entityPath = :path");
static void addAssistants(String role, AssistantSet list, Object data)
void addClause(String clause)
void addNamedValue(String name, Object value)
void setContactId(String contactId)
void setEntityPath(String entityPath)
void setDelivered(boolean delivered)
void addAssistantsByEntity(String entityPath, boolean deep)
void addContact(IContact contact)
void setSchedule(Date schedule)
Collection< SendableAssistant > getAssistants(boolean all)
void setSent(boolean sent)
void setEntityPath(String entityPath)
static IElephantEntity getController(String path)
int executeUpdate(String query)