20 package org.turro.relpaths;
22 import java.util.Date;
23 import java.util.List;
24 import org.turro.contacts.RelatedPaths;
25 import org.turro.contacts.db.ContactsPU;
26 import org.turro.jpa.Dao;
35 public static void addRelation(String origin, String destination, String description) {
52 " delete from RelatedPaths " +
53 " where origin = ? " +
54 " and destination = ?",
55 new Object[] { origin, destination }
62 " delete from RelatedPaths " +
63 " where origin = ? or destination = ?",
64 new Object[] { path, path }
71 " select count(*) from RelatedPaths " +
72 " where origin = ? and destination = ?",
73 new Object[] { origin, destination }
80 " select count(*) from RelatedPaths " +
81 " where origin = ? or destination = ?",
82 new Object[] { path, path }
88 return (List<RelatedPaths>)dao.getResultList(
89 " select rp from RelatedPaths as rp" +
95 public static List<RelatedPaths>
origins(String path) {
97 return (List<RelatedPaths>)dao.getResultList(
98 " select rp from RelatedPaths as rp" +
99 " where destination = ?",
100 new Object[] { path }
int executeUpdate(String query)
Object getSingleResult(WhereClause wc)