Package com.apress.prospring.domain

Examples of com.apress.prospring.domain.Audit


  }
 
  public void testInsert() {
    int count = count();
   
    Audit a = new Audit();
    a.setAuditDate(new Date());
    a.setData("Audit data");
    a.setUser(null);
   
    getDao().insert(a);
    assertTrue(a.getAuditId() > 0);
   
    assertEquals(count + 1, count());
  }
View Full Code Here


    public void setAuditDao(AuditDao auditDao) {
        this.auditDao = auditDao;
    }

    public void writeAuditMessage(String data, User user) {
        Audit audit = new Audit();
        audit.setAuditDate(new Date());
        audit.setData(data);
        if (user != null) {
            audit.setUser(new Integer(user.getUserId()));
        } else {
            audit.setUser(null);
        }

        auditDao.insert(audit);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.springframework.jdbc.object.MappingSqlQuery#mapRow(java.sql.ResultSet, int)
     */
    protected Object mapRow(ResultSet rs, int rowNum) throws SQLException {
      Audit audit = new Audit();

      audit.setAuditDate(rs.getTimestamp("AuditDate"));
      audit.setAuditId(rs.getInt("AuditId"));
      audit.setData(rs.getString("Data"));
      audit.setUser(new Integer(rs.getInt("User")));
      if (rs.wasNull()) audit.setUser(null);

      return audit;
    }
View Full Code Here

TOP

Related Classes of com.apress.prospring.domain.Audit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.