Which one to use for skipping field persisting in an Entity?
@Transient is used as part of JPA to ignore a field from persisting
The transient keyword in Java is used to indicate that a field should not be serialized and persisted (Specification of Java SE 7 Edition)
I checked the both, and for the both no column is generated in the database :
The entity :
@Entity
public class Person implements Serializable{
private static final long serialVersionUID = 1L;
@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
private long id;
private String name;
private String forname;
@Transient
private String nickName;
private transient String pseudo;
The generated table :