我很菜很菜很菜。在dao层里调用session.save(record)的时候,控制台返回的是一个select语句。。
而且没有报错,有哪位高人遇到这个情况?Hibernate: select customer_.customerId, customer_.customer_name as customer2_1_, customer_.address as address1_, customer_.isDefaulter as isDefaul4_1_, customer_.isFrequent as isFrequent1_, customer_.customerAccount as customer6_1_ from t_Customer customer_ where customer_.customerId=?数据库里也没加入record数据。
基本映射情况是Record类里有Customer,Room的引用,主键全是主动分配,debug看过了,值也都在
但就是存不进去。
有哪位高手知道是什么问题么?苦恼半天了Action里的方法是
        RoomForm rf = (RoomForm)form;
Record record = new Record();
Room room = new Room();
Customer customer = new Customer();
customer.setCustomerId(rf.getCustomerId());
room.setRoomId(rf.getRoomId());
String beginDate = rf.getBeginDate();
String endDate = rf.getEndDate();
Date begin = new SimpleDateFormat("yyyy-MM-dd").parse(beginDate);
Date end = new SimpleDateFormat("yyyy-MM-dd").parse(endDate);
record.setBeginDate(begin);
record.setEndDate(end);
record.setCustomer(customer);
record.setRoom(room);
record.setReservationNo(110);//测试,手动分配record主键

roomService.reserve(record);