Package org.openqreg.bean

Examples of org.openqreg.bean.SystemmessageBean


* @return A populated SystemmessageBean
*
* @throws SQLException
*/
protected static SystemmessageBean populate(ResultSet rs) throws SQLException {
SystemmessageBean valueObject = new SystemmessageBean();
valueObject.setId((Long)rs.getObject(1));
valueObject.setLanguageid((String)rs.getObject(2));
valueObject.setHeadline((String)rs.getObject(3));
valueObject.setText((String)rs.getObject(4));
valueObject.setStatus((Integer)rs.getObject(5));
valueObject.setValidfrom((java.sql.Date)rs.getObject(6));
valueObject.setValidto((java.sql.Date)rs.getObject(7));
valueObject.setTscreated((java.sql.Timestamp)rs.getObject(8));
valueObject.setTsupdated((java.sql.Timestamp)rs.getObject(9));
valueObject.setCreatedby((String)rs.getObject(10));
valueObject.setUpdatedby((String)rs.getObject(11));
return valueObject;
}
View Full Code Here


* @throws SQLException
*/
public static Collection<SystemmessageBean> findAll(Connection con) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
SystemmessageBean valueObject = null;
Collection<SystemmessageBean> col = Collections.synchronizedList(new ArrayList<SystemmessageBean>());
try{
pStmt = con.prepareStatement(FIND_ALL_STATEMENT);
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
col.add(valueObject);
}
return col;
}finally{
if(null!=rs){
View Full Code Here

* @throws SQLException
*/
public static Object findByPrimaryKey(Connection con, PrimaryKey key) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
SystemmessageBean valueObject = null;
SystemmessageKey primaryKey = (SystemmessageKey) key;
try{
pStmt = con.prepareStatement(SystemmessageBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getId());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
return valueObject;
}finally{
if(null!=rs){
rs.close();
View Full Code Here

     * must have ADMINUSER_CREATE service<br/>
     *
     */
    if (disp.checkAccess(user.getId(), "ADMINSYSTEMMESSAGE_CREATE")) {
      // new systemmessageBean
      systemmessageBean = new SystemmessageBean();
      populateWithRequestData();
      long time = System.currentTimeMillis();
      systemmessageBean.setTscreated(new Timestamp(time));
      systemmessageBean.setTsupdated(new Timestamp(time));
      systemmessageBean.setCreatedby(user.getId());
View Full Code Here

  }


  @Test
  public void testCreate() throws SQLException {
    SystemmessageBean systemmessage = new SystemmessageBean();
   
    Language language = LanguageFinderBase.findAll(con).iterator().next();
   
    systemmessage.setLanguageid(language.getLanguageid());
   
    StringBuffer text = new StringBuffer();
//    while(text.length()<= 100){
//      text.append("0123456789");
//    }
    systemmessage.setHeadline(text.toString());
//   
//    while(text.length()<= 1500){
//      text.append("0123456789");
//    }   
    systemmessage.setText(text.toString());

    systemmessage.setStatus(new Integer(Status.ACTIVE));
    systemmessage.setValidfrom(new Date(System.currentTimeMillis()));
    systemmessage.setValidto(new Date(System.currentTimeMillis()+10000));
    systemmessage.setTscreated(new Timestamp(System.currentTimeMillis()));
    systemmessage.setCreatedby("System");
    systemmessage.setUpdatedby("System");
   
    systemmessage.create(con);
   
    assertNotNull("Systemmessageid ska inte var null", systemmessage.getId());
  }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.SystemmessageBean

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.