1 package olr.om;
2
3 import org.apache.log4j.Logger;
4 import org.apache.torque.util.Criteria;
5
6 /***
7 * The skeleton for this class was autogenerated by Torque on:
8 *
9 * [Fri Jun 18 10:10:23 CEST 2004]
10 *
11 * You should add additional methods to this class to meet the
12 * application requirements. This class will only be generated as
13 * long as it does not already exist in the output directory.
14 */
15 public class ModelStatementPeer
16 extends olr.om.BaseModelStatementPeer
17 {
18 public static void delete(int modelId, int statementId)
19 throws Exception
20 {
21 Criteria criteria = new Criteria();
22 criteria.add(MODEL_ID, modelId);
23 criteria.add(STATEMENT_ID, statementId);
24 doDelete(criteria, OmContext.getConnection());
25 }
26
27 private static boolean insert(int statementID, int modelID, String modelName)
28 {
29 final ModelStatement modelStatement = new ModelStatement();
30
31 try
32 {
33 modelStatement.setModelId(modelID);
34 modelStatement.setStatementId(statementID);
35 modelStatement.setRdfUser(OmContext.getUser());
36 modelStatement.save(OmContext.getConnection());
37 return true;
38 }
39 catch (Exception e)
40 {
41 Logger.getLogger(ModelStatementPeer.class).error(e);
42 return false;
43 }
44 }
45 }