/** * @author Hyacinthe MENIET * Created on 19 janv. 2006 */ package net.dotmyself.j2sql; import java.io.Serializable; import java.sql.SQLData; import java.sql.SQLException; import java.sql.SQLInput; import java.sql.SQLOutput; /** * Maps Oracle "PERSON" object */ public class PersonBean implements SQLData, Serializable { private String firstname; private String name; private int birthYear; /* (non-Javadoc) * @see java.sql.SQLData#getSQLTypeName() */ public String getSQLTypeName() throws SQLException { return "PERSON"; } /* (non-Javadoc) * @see java.sql.SQLData#readSQL(java.sql.SQLInput, java.lang.String) */ public void readSQL(SQLInput stream, String typeName) throws SQLException { name = stream.readString(); firstname = stream.readString(); birthYear = stream.readInt(); } /* (non-Javadoc) * @see java.sql.SQLData#writeSQL(java.sql.SQLOutput) */ public void writeSQL(SQLOutput stream) throws SQLException { stream.writeString(name); stream.writeString(firstname); stream.writeInt(birthYear); } /** * @return Returns the birthYear. */ public int getBirthYear() { return birthYear; } /** * @param birthYear The birthYear to set. */ public void setBirthYear(int birthYear) { this.birthYear = birthYear; } /** * @return Returns the firstname. */ public String getFirstname() { return firstname; } /** * @param firstname The firstname to set. */ public void setFirstname(String firstname) { this.firstname = firstname; } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name = name; } }