Created
July 30, 2014 15:56
-
-
Save making/69231ecd4f159fde6a1e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package com.example.domain; | |
| import org.hibernate.validator.constraints.URL; | |
| import javax.persistence.Entity; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.Id; | |
| import javax.validation.constraints.NotNull; | |
| import javax.validation.constraints.Size; | |
| @Entity | |
| public class Bookmark { | |
| @Id | |
| @GeneratedValue | |
| private Long id; | |
| @NotNull | |
| @Size(min = 1, max = 255) | |
| private String name; | |
| @NotNull | |
| @Size(min = 1, max = 255) | |
| @URL | |
| private String url; | |
| public Long getId() { | |
| return id; | |
| } | |
| public void setId(Long id) { | |
| this.id = id; | |
| } | |
| public String getName() { | |
| return name; | |
| } | |
| public void setName(String name) { | |
| this.name = name; | |
| } | |
| public String getUrl() { | |
| return url; | |
| } | |
| public void setUrl(String url) { | |
| this.url = url; | |
| } | |
| @Override | |
| public String toString() { | |
| return "Bookmark{" + | |
| "id=" + id + | |
| ", name='" + name + '\'' + | |
| ", url='" + url + '\'' + | |
| '}'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment