|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--test.tester.model.dao.Member
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:
For selecting some rows, you can use the methods inside theMember 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();
MemberBroker.MemberBroker()
class, which has a lot of static methods
that return Collection
s 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.
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 |
public static final java.lang.String TABLE_MEMBER
public static final java.lang.String FIELD_MEMBER_ID
public static final java.lang.String FIELD_LOGIN_NAME
public static final java.lang.String FIELD_PASSWORD_VALUE
public static final java.lang.String FIELD_NAME
public static final java.lang.String FIELD_EMAIL
public static final java.lang.String FIELD_CONFIRM_VALUE
Constructor Detail |
public Member()
public Member(java.sql.ResultSet resultSet) throws DAOException
Member
using the values from the current
row of the given resultSet.
Method Detail |
public java.lang.Integer getMemberId()
memberId
.
public void setMemberId(java.lang.Integer memberId)
memberId
.
public java.lang.String getLoginName()
loginName
.
public void setLoginName(java.lang.String loginName)
loginName
.
public java.lang.String getPasswordValue()
passwordValue
.
public void setPasswordValue(java.lang.String passwordValue)
passwordValue
.
public java.lang.String getName()
name
.
public void setName(java.lang.String name)
name
.
public java.lang.String getEmail()
email
.
public void setEmail(java.lang.String email)
email
.
public java.lang.String getConfirmValue()
confirmValue
.
public void setConfirmValue(java.lang.String confirmValue)
confirmValue
.
public void save() throws DAOException
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.
save
in interface MappedTable
DAOException
public void delete() throws DAOException
member
.
If the memberId is null, that an exception is thrown.
delete
in interface MappedTable
DAOException
public void set(java.sql.ResultSet resultSet) throws DAOException
member
,
to the columns of the current row in the given resultSet.
set
in interface MappedTable
DAOException
public java.lang.String toString()
member
.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |