Skip to content

Instantly share code, notes, and snippets.

@gbougeard
Created May 1, 2012 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbougeard/2568180 to your computer and use it in GitHub Desktop.
Save gbougeard/2568180 to your computer and use it in GitHub Desktop.
Formation entity
@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