@Test public void getUserFromScanner () { Long fid0 = Long.valueOf (0); Long fid1 = Long.valueOf (1); User u = dao.getUserFromScanner (dao.read (fid0)); Assert.assertNotNull (u); Assert.assertEquals (u.getUsername (), "koko"); u = dao.getUserFromScanner (dao.read (fid1)); Assert.assertNotNull (u); Assert.assertEquals (u.getUsername (), "riko"); u = dao.getUserFromScanner (null); Assert.assertNull (u); }
public User getUserFromScanner (FileScanner fs) { return (User)DataAccessUtils.uniqueResult (getHibernateTemplate ().find ( "select u from User u where ? in elements(u.preferences.fileScanners)", fs)); }
FileScannerDao extends HibernateDao<FileScanner, Long> { public User getUserFromScanner (FileScanner fs) { return (User)DataAccessUtils.uniqueResult (getHibernateTemplate ().find ( "select u from User u where ? in elements(u.preferences.fileScanners)", fs)); } }
FileScannerDao extends HibernateDao<FileScanner, Long> { public User getUserFromScanner (FileScanner fs) { return (User)DataAccessUtils.uniqueResult (getHibernateTemplate ().find ( "select u from User u where ? in elements(u.preferences.fileScanners)", fs)); }  }
FileScannerDao extends HibernateDao<FileScanner, Long> { public User getUserFromScanner (FileScanner fs) { return (User)DataAccessUtils.uniqueResult (getHibernateTemplate ().find ( "select u from User u where ? in elements(u.preferences.fileScanners)", fs)); }  int deleteCollectionReferences(final Collection collection); @SuppressWarnings ("unchecked") List<String> getScannerCollections(final Long scan_id); @Override void delete(final FileScanner scanner); void resetAll(); User getUserFromScanner(FileScanner fs); boolean exists(final FileScanner file_scanner); }
FileScannerDao extends HibernateDao<FileScanner, Long> { public User getUserFromScanner (FileScanner fs) { return (User)DataAccessUtils.uniqueResult (getHibernateTemplate ().find ( "select u from User u where ? in elements(u.preferences.fileScanners)", fs)); }  int deleteCollectionReferences(final Collection collection); @SuppressWarnings ("unchecked") List<String> getScannerCollections(final Long scan_id); @Override void delete(final FileScanner scanner); void resetAll(); User getUserFromScanner(FileScanner fs); boolean exists(final FileScanner file_scanner);  }