scone.netobjects
Class User

java.lang.Object
  extended by scone.netobjects.TableRecord
      extended by scone.netobjects.User
All Implemented Interfaces:
Cacheable

public class User
extends TableRecord

A User represents a Scone user. One user can be associated to several persons.

Author:
Harald Weinreich, Volkert Buchmann

Field Summary
static java.lang.String COPYRIGHT
           
protected static DBTableAdapter dbTable
           
protected  Person person
           
 
Fields inherited from class scone.netobjects.TableRecord
ctei, date, fieldValues, hasChanged, hasRecordInDB, persistent
 
Constructor Summary
User(long id)
          Create a new user object with a name if it doesn't exist in the db yet.
User(long id, boolean create)
          Check if a user to an id exists in the db.
User(java.sql.ResultSet results)
          Create User to result of DB query.
User(java.lang.String name)
          Create a new user object
User(java.lang.String name, boolean create)
          Check if a user to a name exists in the db yet.
 
Method Summary
 java.lang.Object getKey(int KeyNo)
          returns the hashkey for this object (to be deprecated!)
 java.lang.String getLastLogin()
           
 Person getPerson()
          returns the person data to this user
 java.lang.String getPersonId()
          returns the personId to the user: One person can have several accounts.
 java.lang.String getUserId()
          returns the id of that user
 java.lang.String getUserName()
          returns the name of the user
 java.lang.String getUserPass()
          returns the password of the user
 void setLastLogin(java.lang.String value)
           
 void setPersonId(java.lang.String value)
          sets the personId to the user: One person can have several accounts.
 void setUserPass(java.lang.String value)
          sets the password of the user
 void store()
          store object to database.
 
Methods inherited from class scone.netobjects.TableRecord
isPersistent, now, setCacheTableEntryInterface, setChanged, setPersistent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

dbTable

protected static DBTableAdapter dbTable

person

protected Person person
Constructor Detail

User

public User(java.lang.String name,
            boolean create)
Check if a user to a name exists in the db yet.

Parameters:
name - the name of the user
create - create in DB if the user does not yet exist. false: check only

User

public User(java.lang.String name)
Create a new user object


User

public User(java.sql.ResultSet results)
Create User to result of DB query.

Parameters:
results - the resultset returned by the query

User

public User(long id,
            boolean create)
Check if a user to an id exists in the db.

Parameters:
id - the id of the user
create - create in DB if the user does not yet exist. false: check only

User

public User(long id)
Create a new user object with a name if it doesn't exist in the db yet.

Parameters:
name - the name of the user
Method Detail

getUserId

public java.lang.String getUserId()
returns the id of that user

Returns:
userId

getUserName

public java.lang.String getUserName()
returns the name of the user

Returns:
userName

getPersonId

public java.lang.String getPersonId()
returns the personId to the user: One person can have several accounts.

Returns:
personId

setPersonId

public void setPersonId(java.lang.String value)
sets the personId to the user: One person can have several accounts.

Parameters:
value - the personId

getPerson

public Person getPerson()
returns the person data to this user

Returns:
person

getUserPass

public java.lang.String getUserPass()
returns the password of the user

Returns:
userPass

setUserPass

public void setUserPass(java.lang.String value)
sets the password of the user

Parameters:
value - the password

getLastLogin

public java.lang.String getLastLogin()

setLastLogin

public void setLastLogin(java.lang.String value)

store

public void store()
store object to database.


getKey

public java.lang.Object getKey(int KeyNo)
Description copied from interface: Cacheable
returns the hashkey for this object (to be deprecated!)

Specified by:
getKey in interface Cacheable
Specified by:
getKey in class TableRecord
Parameters:
KeyNo - the number of the key to be generated
Returns:
the Key(s) corresponding to the object.