From: Peter W. <pw...@us...> - 2006-07-26 11:46:35
|
Update of /cvsroot/cob/COBEditor/src/edu/iastate/ato/po In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31183/src/edu/iastate/ato/po Modified Files: OntologyEdit.java Log Message: Allows term properties to be deleted. Index: OntologyEdit.java =================================================================== RCS file: /cvsroot/cob/COBEditor/src/edu/iastate/ato/po/OntologyEdit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OntologyEdit.java 13 Jun 2006 21:55:24 -0000 1.1 --- OntologyEdit.java 26 Jul 2006 09:37:30 -0000 1.2 *************** *** 67,70 **** --- 67,97 ---- } + + public static boolean deleteTermProperty(Connection db, String term_oid, + String property) + { + if(property == null) + { + return false ; + } + /* e.g. + UPDATE details SET value = 'inch', author = 'user', modified = '...' + WHERE term = '000' AND attribute = 'ScaleUnit' or + + INSERT INTO details ( term, attribute, value, author, modified) + VALUES ('000', 'ScaleUnit' , 'inch', 'user', '....'); + */ + Map field_value = new HashMap<String, String>() ; + field_value.put("term", term_oid) ; + field_value.put("attribute", property) ; + + Vector pks = new Vector<String>() ; + pks.add("term") ; + pks.add("attribute") ; + + return JDBCUtils.delete(db,"details",field_value); + //return JDBCUtils.insertOrUpdateDatabase(db, "details", field_value, pks) ; + } + final public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z") ; |