Created
May 1, 2012 14:14
-
-
Save gbougeard/2568180 to your computer and use it in GitHub Desktop.
Formation entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@Table(name = Formation.TABLE_NAME, | |
uniqueConstraints = { | |
@UniqueConstraint(columnNames = {Formation.COL_COD}) | |
}) | |
@Data | |
public class Formation implements Serializable { | |
private static final long serialVersionUID = 1L; | |
public static final String TABLE_NAME = "formation"; | |
public static final String COL_ID = "id_formation"; | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
@Column(name = COL_ID) | |
private Long idFormation; | |
public static final String COL_LIB = "lib_formation"; | |
@Basic(optional = false) | |
@NotEmpty(message = "Libelle obligatoire") | |
@Size(max = 30) | |
@Column(name = COL_LIB) | |
private String libFormation; | |
public static final String COL_COD = "cod_formation"; | |
@Basic(optional = false) | |
@NotEmpty(message = "Code obligatoire") | |
@Column(name = COL_COD) | |
@Size(max = 3) | |
private String codFormation; | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = FormationItem.PROP_FORMATION) | |
@OrderBy(value=FormationItem.PROP_NUM) | |
private List<FormationItem> formationItemList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment