@Test public void testCreate() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "group.xml"), support.loadFlatXmlDataStream(getClass(), "user.xml") ); support.cleanInsert(support.getConnection(tx), db); tx.commit(); support.initSequences(tx, 10, schema.tableUser.id.getSequenceName()); UserProfile create = dao.create(); create.setDefaultGroup(1); create.setEmail("email"); create.setForename("forename"); create.setUserHome("home"); create.setRemoteName("remoteName"); create.setRemoteType("remoteType"); create.setSurname("surname"); create.setUserGroup(1); create.setUserName("create"); create.setUserPasswordDigest("digest"); dao.update(create); assertNotNull(create.getCreated()); assertEquals((Integer) 1, create.getDefaultGroup()); assertEquals((Integer) 1, create.getUserGroup()); assertEquals("email", create.getEmail()); assertEquals("forename", create.getForename()); assertNotNull(create.getId()); assertEquals("remoteName", create.getRemoteName()); assertEquals("remoteType", create.getRemoteType()); assertEquals("surname", create.getSurname()); assertEquals("home", create.getUserHome()); assertEquals("create", create.getUserName()); assertEquals("digest", create.getUserPasswordDigest()); List<UserProfile> find = dao.find(create.getUserName(), null, create.getRemoteName(), create.getRemoteType()); assertEquals(1, find.size()); UserProfile result = find.get(0); assertNotNull(result.getCreated()); assertEquals(create.getDefaultGroup(), result.getDefaultGroup()); assertEquals(create.getEmail(), result.getEmail()); assertEquals(create.getForename(), result.getForename()); assertEquals(create.getId(), result.getId()); assertEquals(create.getRemoteName(), result.getRemoteName()); assertEquals(create.getRemoteType(), result.getRemoteType()); assertEquals(create.getSurname(), result.getSurname()); assertEquals(create.getUserGroup(), result.getUserGroup()); assertEquals(create.getUserHome(), result.getUserHome()); assertEquals(create.getUserName(), result.getUserName()); assertEquals(create.getUserPasswordDigest(), result.getUserPasswordDigest()); }
@Override public UserProfile create() { return new UserProfile(); }
EmpireUserDao extends EmpireDao implements UserDao { @Override public UserProfile create() { return new UserProfile(); } }
EmpireUserDao extends EmpireDao implements UserDao { @Override public UserProfile create() { return new UserProfile(); } EmpireUserDao(ProarcDatabase db); }
EmpireUserDao extends EmpireDao implements UserDao { @Override public UserProfile create() { return new UserProfile(); } EmpireUserDao(ProarcDatabase db); @Override UserProfile create(); @Override void update(UserProfile user); @Override UserProfile find(int userId); @Override List<UserProfile> find(String userName, String passwd, String remoteName, String remoteType); }
EmpireUserDao extends EmpireDao implements UserDao { @Override public UserProfile create() { return new UserProfile(); } EmpireUserDao(ProarcDatabase db); @Override UserProfile create(); @Override void update(UserProfile user); @Override UserProfile find(int userId); @Override List<UserProfile> find(String userName, String passwd, String remoteName, String remoteType);  }