test.tester.model.dao
Class Member

java.lang.Object
  |
  +--test.tester.model.dao.Member
All Implemented Interfaces:
MappedTable

public class Member
extends java.lang.Object
implements MappedTable

This class, when instancied, is like a row of MEMBER, creating an object mapping into the database.

You can change its columns, then insert, update, delete...

You can do selects and get a Collection of Member back, and you can also do joins (if the table has foreign keys).

Consider the following example to create a new Member in the database:

     Member member = new Member();

     member.setMemberId(new Integer(1));
     member.setLoginName("test");
     member.setPasswordValue("test");
     member.setName("test");
     member.setEmail("test");
     member.setConfirmValue("test");
     ... 

     member.save(); 
 
For selecting some rows, you can use the methods inside the MemberBroker.MemberBroker() class, which has a lot of static methods that return Collections of Member.

This persistence between the object and the database is not thread safe, this means that if you have a change in this row at the database, you will not get here, only if you reload it.

See Also:

Field Summary
static java.lang.String FIELD_CONFIRM_VALUE
          Just a reference for the real SQL name of confirmValue
static java.lang.String FIELD_EMAIL
          Just a reference for the real SQL name of email
static java.lang.String FIELD_LOGIN_NAME
          Just a reference for the real SQL name of loginName
static java.lang.String FIELD_MEMBER_ID
          Just a reference for the real SQL name of memberId
static java.lang.String FIELD_NAME
          Just a reference for the real SQL name of name
static java.lang.String FIELD_PASSWORD_VALUE
          Just a reference for the real SQL name of passwordValue
static java.lang.String TABLE_MEMBER
          Just a reference for the real SQL name of Member
 
Constructor Summary
Member()
          Dummy constructor.
Member(java.sql.ResultSet resultSet)
          Creates a new Member using the values from the current row of the given resultSet.
 
Method Summary
 void delete()
          Deletes this member.
 java.lang.String getConfirmValue()
          Gets the confirmValue.
 java.lang.String getEmail()
          Gets the email.
 java.lang.String getLoginName()
          Gets the loginName.
 java.lang.Integer getMemberId()
          Gets the memberId.
 java.lang.String getName()
          Gets the name.
 java.lang.String getPasswordValue()
          Gets the passwordValue.
 void save()
          Saves this member.
 void set(java.sql.ResultSet resultSet)
          Sets the content of this member, to the columns of the current row in the given resultSet.
 void setConfirmValue(java.lang.String confirmValue)
          Sets the confirmValue.
 void setEmail(java.lang.String email)
          Sets the email.
 void setLoginName(java.lang.String loginName)
          Sets the loginName.
 void setMemberId(java.lang.Integer memberId)
          Sets the memberId.
 void setName(java.lang.String name)
          Sets the name.
 void setPasswordValue(java.lang.String passwordValue)
          Sets the passwordValue.
 java.lang.String toString()
          Returns a structured string representation of this member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_MEMBER

public static final java.lang.String TABLE_MEMBER
Just a reference for the real SQL name of Member

See Also:
Constant Field Values

FIELD_MEMBER_ID

public static final java.lang.String FIELD_MEMBER_ID
Just a reference for the real SQL name of memberId

See Also:
Constant Field Values

FIELD_LOGIN_NAME

public static final java.lang.String FIELD_LOGIN_NAME
Just a reference for the real SQL name of loginName

See Also:
Constant Field Values

FIELD_PASSWORD_VALUE

public static final java.lang.String FIELD_PASSWORD_VALUE
Just a reference for the real SQL name of passwordValue

See Also:
Constant Field Values

FIELD_NAME

public static final java.lang.String FIELD_NAME
Just a reference for the real SQL name of name

See Also:
Constant Field Values

FIELD_EMAIL

public static final java.lang.String FIELD_EMAIL
Just a reference for the real SQL name of email

See Also:
Constant Field Values

FIELD_CONFIRM_VALUE

public static final java.lang.String FIELD_CONFIRM_VALUE
Just a reference for the real SQL name of confirmValue

See Also:
Constant Field Values
Constructor Detail

Member

public Member()
Dummy constructor.


Member

public Member(java.sql.ResultSet resultSet)
       throws DAOException
Creates a new Member using the values from the current row of the given resultSet.

Method Detail

getMemberId

public java.lang.Integer getMemberId()
Gets the memberId.


setMemberId

public void setMemberId(java.lang.Integer memberId)
Sets the memberId.


getLoginName

public java.lang.String getLoginName()
Gets the loginName.


setLoginName

public void setLoginName(java.lang.String loginName)
Sets the loginName.


getPasswordValue

public java.lang.String getPasswordValue()
Gets the passwordValue.


setPasswordValue

public void setPasswordValue(java.lang.String passwordValue)
Sets the passwordValue.


getName

public java.lang.String getName()
Gets the name.


setName

public void setName(java.lang.String name)
Sets the name.


getEmail

public java.lang.String getEmail()
Gets the email.


setEmail

public void setEmail(java.lang.String email)
Sets the email.


getConfirmValue

public java.lang.String getConfirmValue()
Gets the confirmValue.


setConfirmValue

public void setConfirmValue(java.lang.String confirmValue)
Sets the confirmValue.


save

public void save()
          throws DAOException
Saves this member. If the memberId is not null, it will update it, otherwise it is a new record, then it will be inserted.

Keep in mind that if you save it, and it is inserted, the primary key is NOT loaded, so if you save it again, another row will be inserted.

Specified by:
save in interface MappedTable
DAOException

delete

public void delete()
            throws DAOException
Deletes this member. If the memberId is null, that an exception is thrown.

Specified by:
delete in interface MappedTable
DAOException

set

public void set(java.sql.ResultSet resultSet)
         throws DAOException
Sets the content of this member, to the columns of the current row in the given resultSet.

Specified by:
set in interface MappedTable
DAOException

toString

public java.lang.String toString()
Returns a structured string representation of this member.

Overrides:
toString in class java.lang.Object