JPA引文总结

JPA注解总结核心提示:JPA 注解的几个要点 1.设置Pojo为实体 @Entity //标识这个pojo是一个jpa实体 public

JPA注解总结
核心提示:JPA 注解的几个要点 1.设置Pojo为实体 @Entity //标识这个pojo是一个jpa实体 public class Users implements Serializable{ } 2.设置表名 @Entity @Table (name= users ) //指定表名为users public class Users implements Serializable{ } 3.设置主键 public


JPA 注解的几个要点

1.设置Pojo为实体

@Transient    private int tempValue;      public int getTempValue(){    get tempValue;    }      public void setTempValue(int value){    this.tempValue = value;    }