VO 만들기
2018. 3. 9. 22:36
VO 클래스 만들기
- /**
-
*
-
*/
-
package com.javateam.jse.jdbc.domain;
-
-
import java.sql.Date;
-
-
/**
-
* VO(값 객체) : Entity,
-
* POJO(Plain Old Java Object)
-
* , PO(Persistent Object:영속 객체)
-
* @author javateam
-
*
-
*/
-
public class MemberVO {
-
-
// 멤버 필드 = DB 필드
-
-
public MemberVO() {}
-
-
/**
-
* 멤버 필드 초기화 생성자
-
*
-
* @param memberId 회원 아이디
-
* @param mermberName 회원명
-
* @param memberPw 회원 패쓰워드
-
* @param memberAddr 회원 주소
-
* @param memberJoindate 회원 가입일
-
*/
-
this.memberId = memberId;
-
this.mermberName = mermberName;
-
this.memberPw = memberPw;
-
this.memberAddr = memberAddr;
-
this.memberJoindate = memberJoindate;
-
}
-
-
/**
-
* 객체 필드들(내용) 확인
-
* @see java.lang.Object#toString()
-
*/
-
@Override
-
+ "mermberName=%s, "
-
+ "memberPw=%s, "
-
+ "memberAddr=%s, "
-
+ "memberJoindate=%s]",
-
memberId,
-
mermberName,
-
memberPw,
-
memberAddr,
-
memberJoindate);
-
-
-
}
-
-
return memberId;
-
}
-
-
this.memberId = memberId;
-
}
-
-
return mermberName;
-
}
-
-
this.mermberName = mermberName;
-
}
-
-
return memberPw;
-
}
-
-
this.memberPw = memberPw;
-
}
-
-
return memberAddr;
-
}
-
-
this.memberAddr = memberAddr;
-
}
-
-
return memberJoindate;
-
}
-
-
this.memberJoindate = memberJoindate;
-
}
-
-
/**
-
* 두 객체간 필드 값들 비교 (해쉬 코드값으로 비교)
-
* @see java.lang.Object#hashCode()
-
*/
-
@Override
-
public int hashCode() {
-
final int prime = 31;
-
int result = 1;
-
result = prime * result + ((memberAddr == null) ? 0 : memberAddr.hashCode());
-
result = prime * result + ((memberId == null) ? 0 : memberId.hashCode());
-
result = prime * result + ((memberJoindate == null) ? 0 : memberJoindate.hashCode());
-
result = prime * result + ((memberPw == null) ? 0 : memberPw.hashCode());
-
result = prime * result + ((mermberName == null) ? 0 : mermberName.hashCode());
-
return result;
-
}
-
-
/**
-
* 두 객체간 필드 값들 비교(참/거짓으로 비교)
-
* @see java.lang.Object#equals(java.lang.Object)
-
*/
-
@Override
-
if (this == obj) {
-
return true;
-
}
-
if (obj == null) {
-
return false;
-
}
-
if (!(obj instanceof MemberVO)) {
-
return false;
-
}
-
MemberVO other = (MemberVO) obj;
-
if (memberAddr == null) {
-
if (other.memberAddr != null) {
-
return false;
-
}
-
} else if (!memberAddr.equals(other.memberAddr)) {
-
return false;
-
}
-
if (memberId == null) {
-
if (other.memberId != null) {
-
return false;
-
}
-
} else if (!memberId.equals(other.memberId)) {
-
return false;
-
}
-
if (memberJoindate == null) {
-
if (other.memberJoindate != null) {
-
return false;
-
}
-
} else if (!memberJoindate.equals(other.memberJoindate)) {
-
return false;
-
}
-
if (memberPw == null) {
-
if (other.memberPw != null) {
-
return false;
-
}
-
} else if (!memberPw.equals(other.memberPw)) {
-
return false;
-
}
-
if (mermberName == null) {
-
if (other.mermberName != null) {
-
return false;
-
}
-
} else if (!mermberName.equals(other.mermberName)) {
-
return false;
-
}
-
return true;
-
}
-
-
}
'IT 마을 > DB 세포' 카테고리의 다른 글
DAO (interface) 작성 (6) | 2018.03.13 |
---|---|
Oracle - Create , insert , update , delete , drop 테이블 (0) | 2018.03.09 |
ORACLE 설치 / 계정만들기 (0) | 2018.03.08 |