[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model DomainFacade.java,1.4,1.5 Surface.jav
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-09-30 11:15:43
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20476/src/net/sourceforge/bprocessor/model Modified Files: DomainFacade.java Surface.java ConstructionSpaceFacade.java FunctionalSpaceFacade.java Log Message: Removed some unused methods Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Surface.java 30 Sep 2005 08:14:24 -0000 1.33 --- Surface.java 30 Sep 2005 11:15:34 -0000 1.34 *************** *** 533,561 **** } - /** - * Get the front Space - * @return The space in front of the surfacespace - */ - public Space getFrontSpace() { - Set set = FunctionalSpaceFacade.getInstance().findBySurface(this); - //log.info("spaces found " + set.size()); - if (set != null) { - Iterator it = set.iterator(); - if (it.hasNext()) { - Space s = (Space)it.next(); - return s; - } - } - return null; - } - - /** - * Get the rear Space - * @return The rear space - */ - public Space getRearSpace() { - return null; - } - /** * Get the whether this is an inner surface. --- 533,536 ---- Index: ConstructionSpaceFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ConstructionSpaceFacade.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ConstructionSpaceFacade.java 30 Sep 2005 08:14:24 -0000 1.10 --- ConstructionSpaceFacade.java 30 Sep 2005 11:15:34 -0000 1.11 *************** *** 248,286 **** return result; } - - /** - * Find the Construction spaces matched with a surface - * @param surface The surface - * @return The space the given surface is conected with - */ - public synchronized Set findBySurface(Surface surface) { - Set result = new HashSet(); - - HibernateUtil hu = HibernateUtil.getInstance(); - Transaction tx = null; - try { - Session session = hu.currentSession(); - tx = session.beginTransaction(); - - Query q = session.createQuery("SELECT cs FROM ConstructionSpace AS cs," + - "Domain AS d " + - "JOIN d.surfaces AS surfaces " + - "WHERE surfaces.id = :id AND d.id = cs.id"); - q.setLong("id", surface.getId().longValue()); - - Iterator it = q.iterate(); - while (it.hasNext()) { - result.add((ConstructionSpace)it.next()); - } - tx.commit(); - } catch (Exception ex) { - if (tx != null) { - tx.rollback(); - } - log.error(ex.getMessage(), ex); - } finally { - hu.closeSession(); - } - return result; - } } --- 248,250 ---- Index: DomainFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/DomainFacade.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DomainFacade.java 21 Sep 2005 14:04:33 -0000 1.4 --- DomainFacade.java 30 Sep 2005 11:15:34 -0000 1.5 *************** *** 123,160 **** return result; } - - /** - * Find all the domains associated with a surface - * @param surface the surface - * @return the set of domains - */ - public synchronized Set findBySurface(Surface surface) { - Set result = new HashSet(); - - HibernateUtil hu = HibernateUtil.getInstance(); - Transaction tx = null; - try { - Session session = hu.currentSession(); - tx = session.beginTransaction(); - - Query q = session.createQuery("SELECT d FROM Domain AS d " + - "JOIN d.surfaces AS surfaces " + - "WHERE surfaces.id = :id"); - q.setLong("id", surface.getId().longValue()); - - Iterator it = q.iterate(); - while (it.hasNext()) { - result.add((Domain)it.next()); - } - tx.commit(); - } catch (Exception ex) { - if (tx != null) { - tx.rollback(); - } - log.error(ex.getMessage(), ex); - } finally { - hu.closeSession(); - } - return result; - } } --- 123,125 ---- Index: FunctionalSpaceFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/FunctionalSpaceFacade.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FunctionalSpaceFacade.java 30 Sep 2005 08:14:24 -0000 1.10 --- FunctionalSpaceFacade.java 30 Sep 2005 11:15:34 -0000 1.11 *************** *** 248,286 **** return result; } - - /** - * Find the Functional spaces matched with a surface - * @param surface The the surface - * @return The space the given surface is conected with - */ - public synchronized Set findBySurface(Surface surface) { - Set result = new HashSet(); - - HibernateUtil hu = HibernateUtil.getInstance(); - Transaction tx = null; - try { - Session session = hu.currentSession(); - tx = session.beginTransaction(); - - Query q = session.createQuery("SELECT f FROM FunctionalSpace AS f," + - "Domain AS d " + - "JOIN d.surfaces AS surfaces " + - "WHERE surfaces.id = :id AND d.id = f.id"); - q.setLong("id", surface.getId().longValue()); - - Iterator it = q.iterate(); - while (it.hasNext()) { - result.add((FunctionalSpace)it.next()); - } - tx.commit(); - } catch (Exception ex) { - if (tx != null) { - tx.rollback(); - } - log.error(ex.getMessage(), ex); - } finally { - hu.closeSession(); - } - return result; - } } --- 248,250 ---- |