18 package org.turro.activity;
20 import java.util.List;
21 import org.turro.elephant.db.WhereClause;
22 import org.turro.financials.db.FinancialsPU;
23 import org.turro.financials.entity.Contract;
24 import org.turro.financials.menu.FinancialsMenu;
25 import org.turro.i18n.I_;
26 import org.turro.jpa.Dao;
27 import org.turro.path.Path;
28 import org.turro.plugin.contacts.IContact;
39 return "BrightSide Financials - " +
I_.
get(
"Contract");
49 if(!entityPath.isRoot() &&
"contact".equals(entityPath.getRoot())) {
51 wc.
addClause(
"select distinct contract from Contract as contract");
52 wc.
addClause(
"left join contract.participants as participant");
53 wc.
addClause(
"where contract.contractor = :id");
55 wc.
addClause(
"or participant.idContact = :id2");
87 List<Contract> contracts =
getDao().getResultList(
88 "select c from Contract c where c.contractor = ?",
89 new Object[] { contact.
getId() });
92 "update Contract set name = ? " +
94 new Object[] { contract.getFullDescription(), contract.getId() });
97 "update ContractParticipant set name = ? " +
98 "where idContact = ?",
boolean getCanChangeFor(Contract v)
Object getReferringEntity(Contract v)
WhereClause getQuery(Path entityPath)
void onDelete(Object entity)
boolean getCanDelete(Contract v)
void doDelete(Contract v)
String getDescription(Contract v)
void onChange(Object entity)
void doChangeFor(Contract v, Path toPath)
void addClause(String clause)
void addNamedValue(String name, Object value)
static String get(String msg)
void deleteObject(Object obj)
int executeUpdate(String query)