19 package org.turro.contacts.relation;
21 import java.util.List;
22 import org.turro.action.queue.ConstraintKeys;
23 import org.turro.string.Strings;
24 import org.turro.contacts.BusinessRelation;
25 import org.turro.contacts.db.ContactsPU;
26 import org.turro.elephant.db.SQLHelper;
27 import org.turro.elephant.db.WhereClause;
28 import org.turro.elephant.util.Messages;
29 import org.turro.jpa.Dao;
30 import org.turro.mail.queue.QueueManager;
31 import org.turro.security.SocialGroups;
32 import org.zkoss.bind.BindUtils;
33 import org.zkoss.bind.annotation.BindingParam;
34 import org.zkoss.bind.annotation.Command;
35 import org.zkoss.bind.annotation.NotifyChange;
43 private String searchValue;
48 @NotifyChange(
"model")
51 if(relation !=
null) {
53 getDao().saveObject(relation);
62 if(relation !=
null) {
65 BindUtils.postNotifyChange(
null,
null,
RelationsVM.this,
"model");
70 @NotifyChange(
"model")
76 wc.
addClause(
"select r from BusinessRelation r");
77 wc.
addClause(
"where r.validated = FALSE");
78 if(!Strings.isBlank(searchValue)) {
79 wc.
addClause(
"and (r.contact.name like :searchValue");
80 wc.
addClause(
"or r.business.name like :searchValue)");
83 return getDao().getResultList(wc);
91 this.searchValue = searchValue;
98 private Dao getDao() {
static ConstraintKeys from(IContact contact)
static String convertToPartialLike(String value)
void addClause(String clause)
void addNamedValue(String name, Object value)
static Messages confirmDeletion()
void deleteObject(Object obj)
void subscribeDefaults(ConstraintKeys keys)
static void checkInheritance(List< Contact > contacts, Dao dao)