@@ -21,30 +21,30 @@ public abstract class EmailDAO implements Transactional<EmailDAO> {
2121
2222 @ RegisterMapperFactory (TCBeanMapperFactory .class )
2323 @ SqlQuery (
24- "SELECT " + EMAIL_COLUMNS + " FROM email e WHERE user_id = :userId and email_type_id = :typeId"
24+ "SELECT " + EMAIL_COLUMNS + " FROM common_oltp. email e WHERE user_id = :userId and email_type_id = :typeId"
2525 )
2626 protected abstract Email findEmail (@ Bind ("userId" ) long userId , @ Bind ("typeId" ) int typeId );
2727
2828 @ SqlQuery (
29- "SELECT COUNT(user_id) FROM email WHERE LOWER(address)=LOWER(:email)"
29+ "SELECT COUNT(user_id) FROM common_oltp. email WHERE LOWER(address)=LOWER(:email)"
3030 )
3131 protected abstract int countEmail (@ Bind ("email" ) String email );
3232
3333 @ SqlUpdate (
34- "INSERT INTO email " +
34+ "INSERT INTO common_oltp. email " +
3535 "(user_id, email_id, email_type_id, address, primary_ind, status_id) VALUES " +
3636 "(:userId, :emailId, 1, :email, 1, :statusId)" )
3737 protected abstract int createEmail (@ Bind ("userId" ) long userId , @ Bind ("emailId" ) long emailId , @ Bind ("email" ) String email , @ Bind ("statusId" ) int statusId );
3838
3939 @ SqlUpdate (
40- "UPDATE email SET " +
41- "email_type_id = :e.typeId, address = :e.address, primary_ind = DECODE( :e.typeId, 1, 1, 0 ) " +
40+ "UPDATE common_oltp. email SET " +
41+ "email_type_id = :e.typeId, address = :e.address, primary_ind = (CASE WHEN :e.typeId = 1 THEN 1 ELSE 0 END ) " +
4242 "WHERE email_id = :e.id"
4343 )
4444 protected abstract int updateEmail (@ BindBean ("e" ) Email email );
4545
4646 @ SqlUpdate (
47- "UPDATE email SET status_id = 1 WHERE user_id = :userId AND email_type_id = 1"
47+ "UPDATE common_oltp. email SET status_id = 1 WHERE user_id = :userId AND email_type_id = 1"
4848 )
4949 protected abstract int activateEmail (@ Bind ("userId" ) long userId );
5050
0 commit comments