第一种写法
public class Course implements java.io.Serializable {// Fieldsprivate Integer courId;
private String courName;
private String courTeacher;
private Byte valid;
private Set studies = new HashSet(0);
}第二种写法
public class Course {// Fieldsprivate int courId;
private String courName;
private String courTeacher;
private byte valid;
private Set <study> studies= new hashSet<study>();
}
这两种写法有在使用上有什么区别,传统的应该是第2种吧,第一种怎么理解呢,第一种是从数据库表中的数据建立实体类,第二种可以从实体类中生成数据库表,那种实际开发中更好