可以排出的是,dao被扫描到了
因为有一个模块可以查询出所有
OrdersDao.java
@Select("select * from orders")
@Results({
@Result(id = true, property = "id", column = "id"),
@Result(property = "orderNum", column = "orderNum"),
@Result(property = "orderTime", column = "orderTime"),
@Result(property = "orderStatus", column = "orderStatus"),
@Result(property = "peopleCount", column = "peopleCount"),
@Result(property = "payType", column = "payType"),
@Result(property = "orderDesc", column = "orderDesc"),
@Result(property = "product", column = "productId", javaType = Product.class, one = @One(select = "com.jt.ssm.dao.ProductDao.findById"))
})
List<Orders> findAll() throws Exception;
ProductDao.java
@Select("select * from product")
List<Product> findAll() throws Exception;
Orders实体类和Product实体类中的属性
创建Orders表的sql
CREATE TABLE orders(
id varchar2(32) default SYS_GUID() PRIMARY KEY,
orderNum VARCHAR2(20) NOT NULL UNIQUE,
orderTime timestamp,
peopleCount INT,
orderDesc VARCHAR2(500),
payType INT,
orderStatus INT,
productId varchar2(32),
memberId varchar2(32),
FOREIGN KEY (productId) REFERENCES product(id),
FOREIGN KEY (memberId) REFERENCES member(id)
);
检查了,没找出不一样的地方
真不知道出错在哪了
日志信息
为了检查错误,在OrdersServiceImpl中将orderDao和查询返回的ordersLIst打印出来了
可以明显看出ordersLIst集合里没有元素
控制台日志显示也没数据
难道是因为,我没有将Orders实体类完全封装完吗??
还有Member和List
可是我只是查询orders和product表联查呀