public void remove(Integer docLibId, Integer catTypeId) { RelTableDocLibFields[] fieldz = this.getRelTableDocLibFields(docLibId, catTypeId); BaseDAO dao = new BaseDAO(); for (int i = 0; i < fieldz.length; i++) { RelTableDocLibFields fields = fieldz[i]; dao.delete(fields); } }
public RelTableDocLibFields[] getRelTableDocLibFields(Integer docLibId, Integer catTypeId) { BaseDAO dao = new BaseDAO(); List l = dao.find( "from RelTableDocLibFields as fields where fields.docLibID=:docLibID and fields.catTypeID=:catTypeID", new String[] {"docLibID", "catTypeID"}, new Object[] {docLibId, catTypeId}, new Type[] {Hibernate.INTEGER, Hibernate.INTEGER}); return (RelTableDocLibFields[]) l.toArray(new RelTableDocLibFields[0]); }