Created
December 10, 2012 03:42
-
-
Save krams915/4248267 to your computer and use it in GitHub Desktop.
Spring Social User.java
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 org.krams.domain; | |
| import javax.persistence.CascadeType; | |
| import javax.persistence.Column; | |
| import javax.persistence.Entity; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.GenerationType; | |
| import javax.persistence.Id; | |
| import javax.persistence.OneToOne; | |
| import org.codehaus.jackson.annotate.JsonManagedReference; | |
| @Entity(name="user") | |
| public class User { | |
| @Id | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| private Long id; | |
| private String firstName; | |
| private String lastName; | |
| @Column(unique=true) | |
| private String username; | |
| private String password; | |
| @JsonManagedReference | |
| @OneToOne(mappedBy="user", cascade={CascadeType.ALL}) | |
| private Role role; | |
| public User() {} | |
| ...getters/setters | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment