FileDocCategorySizeDatePackage
CreateComment.javaAPI DocExample1847Mon Mar 31 23:08:52 BST 2003org.dasein.gb.persist

CreateComment

public class CreateComment extends org.dasein.persist.Execution

Fields Summary
private static final String
CREATE
private static final int
COMMENT_ID
private static final int
CREATED
private static final int
APPROVED
private static final int
EMAIL
private static final int
NAME
private static final int
COMMENT
Constructors Summary
Methods Summary
public java.lang.StringgetDataSource()

        return "jdbc/kyra";
    
public static org.dasein.gb.persist.CreateCommentgetInstance()

        return (CreateComment)Execution.getInstance(CreateComment.class);
    
public java.lang.StringgetStatement()

        return CREATE;
    
public java.util.HashMaprun()

    
          
        Date now = new Date(System.currentTimeMillis());
        String tmp;
        Long val;

        val = (Long)data.get(Comment.COMMENT_ID);
        statement.setLong(COMMENT_ID, val.longValue());
        statement.setDate(CREATED, now);
        statement.setString(APPROVED, "N");
        tmp = (String)data.get(Comment.EMAIL);
        if( tmp == null ) {
            statement.setNull(EMAIL, Types.VARCHAR);
        }
        else {
            statement.setString(EMAIL, tmp);
        }
        statement.setString(NAME, (String)data.get(Comment.NAME));
        statement.setString(COMMENT, (String)data.get(Comment.COMMENT));
        statement.executeUpdate();
        data.put(Comment.CREATED, now);
        return null;