Class UserEntity
- java.lang.Object
-
- org.drdeesw.commons.models.base.entities.AbstractUniqueEntity<java.lang.Long>
-
- org.drdeesw.commons.models.base.entities.AbstractLongUniqueEntity
-
- org.drdeesw.commons.models.security.entities.UserEntity
-
- All Implemented Interfaces:
java.io.Serializable,DataTransferObject,UniqueEntity<java.lang.Long>,LongUniqueObject,UniqueObject<java.lang.Long>,User
@MappedSuperclass public abstract class UserEntity extends AbstractLongUniqueEntity implements User
Structured to work with JdbcUserDetailsManager. This is an abstract class so that subclasses can define the schema and table names.- Author:
- gary_kephart
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUserEntity()HibernateprotectedUserEntity(java.lang.Long id)UserEntity(java.lang.String username)For testing.UserEntity(java.lang.String username, boolean enabled)For when logging in reveals a new user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.LonggetId()Returns the ID of the object.java.lang.StringgetUsername()The email address is the usernamebooleanisEnabled()voidsetEnabled(boolean enabled)voidsetUsername(java.lang.String email)-
Methods inherited from class org.drdeesw.commons.models.base.entities.AbstractLongUniqueEntity
update
-
Methods inherited from class org.drdeesw.commons.models.base.entities.AbstractUniqueEntity
cast, equals, equalsWithNullCheck, hashCode, setId, toString, update
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drdeesw.commons.models.base.LongUniqueObject
setId
-
-
-
-
Constructor Detail
-
UserEntity
protected UserEntity()
Hibernate
-
UserEntity
protected UserEntity(java.lang.Long id)
-
UserEntity
public UserEntity(java.lang.String username)
For testing.- Parameters:
username- perhaps the email address
-
UserEntity
public UserEntity(java.lang.String username, boolean enabled)For when logging in reveals a new user.- Parameters:
username-enabled-
-
-
Method Detail
-
getId
public java.lang.Long getId()
Description copied from class:AbstractUniqueEntityReturns the ID of the object. Subclasses need to specify the Column annotation. The ID annotation is necessary: "You cannot override the [id] non-identifier property from the [...AbstractUniqueObject] base class or MappedSuperclass and make it an identifier in the subclass!" So we should not need it in the subclasses.- Specified by:
getIdin interfaceUniqueObject<java.lang.Long>- Specified by:
getIdin interfaceUser- Overrides:
getIdin classAbstractUniqueEntity<java.lang.Long>- Returns:
- the unique id of the object.
-
getUsername
public java.lang.String getUsername()
The email address is the username- Specified by:
getUsernamein interfaceUser- Returns:
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfaceUser- Parameters:
enabled- the enabled to set
-
setUsername
public void setUsername(java.lang.String email)
- Specified by:
setUsernamein interfaceUser
-
-