hibernate 3.0 使用复合主键的类。一定要实现serializable接口。否则就会出现:java.lang.ClassCastException错误。很容易忽略的问题。今天在这个问题上浪费了很多时间。