Skip to content

Instantly share code, notes, and snippets.

@sejersbol
Created February 26, 2011 08:45
Show Gist options
  • Save sejersbol/845062 to your computer and use it in GitHub Desktop.
Save sejersbol/845062 to your computer and use it in GitHub Desktop.
Check database constraints on-the-fly.
...
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
@Data
public class SomeDto {
@Min(0)
private int id;
@Size(min=2, max=8)
private String firstName;
@NotNull
private String lastName;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment