Type mismatch: cannot convert from Message to MessageDao

Gmonday 2013-11-12 01:04:54
错误是Type mismatch: cannot convert from Message to MessageDao

beans

public class Message {
private int messageID;
private String messageTitle;
private String messageContext;
private Date publishTime;
private int employeeID;

public int getMessageID() {
return messageID;
}
public void setMessageID(int messageID) {
this.messageID = messageID;
}
public String getMessageTitle() {
return messageTitle;
}
public void setMessageTitle(String messageTitle) {
this.messageTitle = messageTitle;
}
public String getMessageContext() {
return messageContext;
}
public void setMessageContext(String messageContext) {
this.messageContext = messageContext;
}
public int getEmployeeID() {
return employeeID;
}
public void setEmployeeID(int employeeID) {
this.employeeID = employeeID;
}
public Date getPublishTime() {
return publishTime;
}
public void setPublishTime(Date publishTime) {
this.publishTime = publishTime;
}
}




public interface MessageDao {
public void addMessage(Message message);
public void delMessage(int messageID);
public Message findMessageByID(int messageID);
public void updataMessage(Message message);
public List<Message> findAllMessages(Page page);
public int findAllCount();
}



public class MessageDaoFactory {
public static Message createMassage(){
return new Message();

}
}


错误在此:

MessageDao messageDao=MessageDaoFactory.createMassage();//此处报错
Page newPage=PageDetails.createPage(5, 1,messageDao.findAllCount());
...全文
368 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Gmonday 2013-11-12
  • 打赏
  • 举报
回复
引用 2 楼 huxiweng 的回复:

public class MessageDaoFactory {
    public static MessageDao createMassage(){
        return new MessageDao ();
         
    }
}
太感谢了 版主!!!
teemai 2013-11-12
  • 打赏
  • 举报
回复

public class MessageDaoFactory {
    public static MessageDao createMassage(){
        return new MessageDao ();
         
    }
}
tony4geek 2013-11-12
  • 打赏
  • 举报
回复
Message 和 MessageDao 没关系,你看下你的 Message  没实现,没继承怎么返回。
笔记本的风扇控制 ---------------------------------------- 09 November 2006. Summary of changes for version 20061109: 1) ACPI CA Core Subsystem: Optimized the Load ASL operator in the case where the source operand is an operation region. Simply map the operation region memory, instead of performing a bytewise read. (Region must be of type SystemMemory, see below.) Fixed the Load ASL operator for the case where the source operand is a region field. A buffer object is also allowed as the source operand. BZ 480 Fixed a problem where the Load ASL operator allowed the source operand to be an operation region of any type. It is now restricted to regions of type SystemMemory, as per the ACPI specification. BZ 481 Additional cleanup and optimizations for the new Table Manager code. AcpiEnable will now fail if all of the required ACPI tables are not loaded (FADT, FACS, DSDT). BZ 477 Added #pragma pack(8/4) to acobject.h to ensure that the structures in this header are always compiled as aligned. The ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work if it is byte-packed. Example Code and Data Size: These are the sizes for the OS- independent acpica.lib produced by the Microsoft Visual C++ 6.0 32- bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Previous Release: Non-Debug Version: 78.1K Code, 17.1K Data, 95.2K Total Debug Version: 155.4K Code, 63.1K Data, 218.5K Total Current Release: Non-Debug Version: 77.9K Code, 17.0K Data, 94.9K Total Debug Version: 155.2K Code, 63.1K Data, 218.3K Total 2) iASL Compiler/Disassembler and Tools: Fixed a problem where the presence of the _OSI predefined control method within complex expressions could cause an internal compiler error. AcpiExec: Implemented full region support for multiple address spaces. SpaceId is now part of the REGION object. BZ 429 ---------------------------------------- 11 Oc

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧