rendered paste bodyACTION CLASS:
int alertId = AlertLoggingService.getInstance().insertAlertLog(alVO); //get the ALERT ID OF THIS ISSUE
System.out.println("ALERT ID: " + alertId);
********************************************************
SERVICE CLASS:
public int insertAlertLog(Object parameterObject) throws DaoException {
return alDao.insertAlertLog(parameterObject);
}
*************************************************************************
DAO CLASS:
public int insertAlertLog(Object parameterObject) throws DaoException {
return super.insert("AlertLoggingSQL.insertAlertLog", parameterObject);
}
*******************************************************************
SQL MAP:
<typeAlias alias="alertLoggingVO" type="net.forcedata.asset.ibatis.domain.AlertLoggingVO" />
<resultMap id="alertLog" class="net.forcedata.asset.ibatis.domain.AlertLoggingVO">
<!-- <resultMap id="alertLog" parameterClass="alertLoggingVO"> -->
<result property="id" column="id"/>
<result property="timestamp" column="timestamp"/>
<result property="alertType" column="type"/>
<result property="tagId" column="tag_id"/>
<result property="mnemonic" column="mnemonic"/>
<result property="locationStr" column="location_str"/>
<result property="categoryStr" column="category_str"/>
<result property="upperLimitAlert" column="upper_limit_alert" nullValue="0" />
<result property="upperLimit" column="upper_limit"/>
<result property="lowerLimit" column="lower_limit" nullValue="0" />
<result property="lowerLimitAlert" column="lower_limit_alert" nullValue="0" />
<result property="measuredValue" column="measured_value" nullValue="0" />
</resultMap>
<insert id="insertAlertLog" parameterClass="alertLoggingVO">
insert into alert_logging (id, timestamp, type, tag_id, mnemonic, location_str, category_str, upper_limit_alert, upper_limit, lower_limit, lower_limit_alert, measured_value)
values(#id#, #timestamp#, #tagId#, #alertType#, #mnemonic#, #locationStr#, #categoryStr#, #upperLimitAlert#, #upperLimit#, #lowerLimit#, #lowerLimitAlert#, #measuredValue#)
<selectKey keyProperty="id" resultClass="Integer">
select LAST_INSERT_ID() as id
</selectKey>
</insert>