001/* 002 * Copyright 2012 Atteo. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.atteo.moonshine.shiro.database; 017 018import javax.persistence.Column; 019import javax.persistence.Entity; 020import javax.persistence.Id; 021 022import org.hibernate.validator.constraints.NotBlank; 023 024@Entity 025public class Account { 026 @Id 027 @NotBlank 028 private String login; 029 030 @Column(nullable = false) 031 @NotBlank 032 private String hashedPassword; 033 034 @Column(length = 256, nullable = false) 035 @NotBlank 036 private String salt; 037 038 public String getLogin() { 039 return login; 040 } 041 042 public void setLogin(String login) { 043 this.login = login; 044 } 045 046 public void setSalt(String salt) { 047 this.salt = salt; 048 } 049 050 public String getSalt() { 051 return salt; 052 } 053 054 public String getHashedPassword() { 055 return hashedPassword; 056 } 057 058 public void setHashedPassword(String hashedPassword) { 059 this.hashedPassword = hashedPassword; 060 } 061}