⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messagesserviceimp.java

📁 java开发的经典框架assh,做的一个系统!
💻 JAVA
字号:

package com.caolulu.assh.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.caolulu.assh.bean.Messages;
import com.caolulu.assh.comm.PageList;
import com.caolulu.assh.comm.Pages;
import com.caolulu.assh.dao.MessagesDAO;
import com.caolulu.assh.exception.CommunityHandleException;
import com.caolulu.assh.service.MessagesService;

public class MessagesServiceImp implements MessagesService {

  private static final Log logger = LogFactory.getLog(MessagesServiceImp.class);

  private MessagesDAO messagesDAO;

  public MessagesDAO getMessagesDAO() {

    return messagesDAO;
  }

  public void setMessagesDAO(MessagesDAO messagesDAO) {

    this.messagesDAO = messagesDAO;
  }

  public Messages createObject(Messages messages)
          throws CommunityHandleException {

    try {
      return this.getMessagesDAO().createObject(messages);
    } catch (Exception e) {
      logger.error("createObject:" + e);
      throw new CommunityHandleException(e);
    }
  }

  public Messages findObjectById(long id) {

    return this.getMessagesDAO().findObjectById(id);
  }

  public PageList findObjectByChangCiId(Pages pages, long changCiId) {

    PageList pageList = new PageList();
    pages.setTotals(this.getMessagesDAO().getObjectByChangCiId(changCiId));
    pages.doPageBreak();
    List list = this.getMessagesDAO().findObjectByChangCiId(changCiId,
            pages.getSpage(), pages.getPerPageNum());
    pageList.setObjectList(list);
    pageList.setPageShowString(pages.getListPageBreak());
    pageList.setPages(pages);
    return pageList;
  }

  public List findObjectByChangCiId(final long changCiId) {

    return this.getMessagesDAO().findObjectByChangCiId(changCiId);
  }

  public void removeObjectByChangCiId(long changCiId)
          throws CommunityHandleException {

    try {
      this.getMessagesDAO().removeObjectByChangCiId(changCiId);
    } catch (Exception e) {
      logger.error("removeObjectByChangCiId:" + e);
      throw new CommunityHandleException(e);
    }
  }

  public void removeObjectById(long Id) throws CommunityHandleException {

    try {
      this.getMessagesDAO().removeObjectById(Id);
    } catch (Exception e) {
      logger.error("removeObjectById:" + e);
      throw new CommunityHandleException(e);
    }
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -