Skip to content

Instantly share code, notes, and snippets.

@php-coder
Created March 24, 2012 12:20
Show Gist options
  • Save php-coder/2181923 to your computer and use it in GitHub Desktop.
Save php-coder/2181923 to your computer and use it in GitHub Desktop.
Lombok annotations at members and at class
@Entity
@Table(name = "countries")
@Getter
@Setter
public class Country {
public static final int NAME_LENGTH = 50;
@Id
@GeneratedValue
private Integer id;
@Column(length = NAME_LENGTH, unique = true, nullable = false)
private String name;
@Column(name = "created_at", nullable = false)
private Date createdAt;
}
@Entity
@Table(name = "countries")
public class Country {
public static final int NAME_LENGTH = 50;
@Getter
@Setter
@Id
@GeneratedValue
private Integer id;
@Getter
@Setter
@Column(length = NAME_LENGTH, unique = true, nullable = false)
private String name;
@Getter
@Setter
@Column(name = "created_at", nullable = false)
private Date createdAt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment