列注释在 JPA 中绝对必要?
我还有一个关于JPA的问题。如果我想将每个成员变量存储在我的数据库中,是否有必要用@Column对其进行注释?或者是否可以通过一些成员变量将其省略(在这些示例中为字段“时间戳”),并且在每种可能的情况下,此字段将存储在数据库中:
@Entity
@Table(name = "usercontent")
public class UserContentEntity implements Persistable<Long> {
   /** serialVersionUID */
   private static final long serialVersionUID = 1L;
   @Id
   @GeneratedValue(strategy = GenerationType.AUTO)
   private Long id;
   @Column(name = "description")
   private String contentdescription;
   @Column(name = "name")
   private String contentname;
   @Column(name = "bytes")
   @Lob
   private byte[] contentbytes;
   @Column
   private String creator;
   private Date timestamp;
   // get- and set methods
}
当绝对有必要使用注释时,@Column?
谢谢麦克
 
					 
				 
				    		 
				    		 
				    		 
				    		