package examples.dbo; /* * Auto generated on: Mon Apr 09 17:11:07 EDT 2007 * JDBC url: [jdbc:postgresql://localhost/test] * WARNING: Manual edits will be lost if/when this file is regenerated. */ import java.io.*; import java.math.*; import java.sql.*; import java.util.*; import fc.io.*; import fc.jdbc.*; import fc.jdbc.dbo.*; import fc.util.*; import fc.web.forms.*; /** Represents a row in the mollytest table. */ public class mollytest extends fc.jdbc.dbo.DBO { /* Default constructor */ public mollytest() { this.__isNew = true; } /*--------------------- Columns ------------------------*/ private int uid; /** serial (INTEGER); PK=yes; Nullable=false; AutoInc=true; MaxSize=10 */ private String name; /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ private String email; /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ private String password; /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ private java.sql.Date created_on; /** date (DATE); Nullable=true; AutoInc=false; MaxSize=13 */ private boolean is_active; /** bool (BIT); Nullable=true; AutoInc=false; MaxSize=1 */ /*------------------------------------------------------*/ boolean __force_update = false; private Map __extra_data; private boolean __isNew = false; private boolean __isModified = false; private boolean __isModified_uid = false; protected boolean __isNullInDB_uid = false; /**returns <tt>true</tt> if uid has changed since it was created/loaded, <tt>false</tt> otherwise*/ public boolean isModified_uid() { return this.__isModified_uid; } /**returns <tt>true</tt> if uid is null in the database*/ public boolean isNullInDB_uid() { return this.__isNullInDB_uid; } private boolean __isModified_name = false; protected boolean __isNullInDB_name = false; /**returns <tt>true</tt> if name has changed since it was created/loaded, <tt>false</tt> otherwise*/ public boolean isModified_name() { return this.__isModified_name; } /**returns <tt>true</tt> if name is null in the database*/ public boolean isNullInDB_name() { return this.__isNullInDB_name; } private boolean __isModified_email = false; protected boolean __isNullInDB_email = false; /**returns <tt>true</tt> if email has changed since it was created/loaded, <tt>false</tt> otherwise*/ public boolean isModified_email() { return this.__isModified_email; } /**returns <tt>true</tt> if email is null in the database*/ public boolean isNullInDB_email() { return this.__isNullInDB_email; } private boolean __isModified_password = false; protected boolean __isNullInDB_password = false; /**returns <tt>true</tt> if password has changed since it was created/loaded, <tt>false</tt> otherwise*/ public boolean isModified_password() { return this.__isModified_password; } /**returns <tt>true</tt> if password is null in the database*/ public boolean isNullInDB_password() { return this.__isNullInDB_password; } private boolean __isModified_created_on = false; protected boolean __isNullInDB_created_on = false; /**returns <tt>true</tt> if created_on has changed since it was created/loaded, <tt>false</tt> otherwise*/ public boolean isModified_created_on() { return this.__isModified_created_on; } /**returns <tt>true</tt> if created_on is null in the database*/ public boolean isNullInDB_created_on() { return this.__isNullInDB_created_on; } private boolean __isModified_is_active = false; protected boolean __isNullInDB_is_active = false; /**returns <tt>true</tt> if is_active has changed since it was created/loaded, <tt>false</tt> otherwise*/ public boolean isModified_is_active() { return this.__isModified_is_active; } /**returns <tt>true</tt> if is_active is null in the database*/ public boolean isNullInDB_is_active() { return this.__isNullInDB_is_active; } /** returns <tt>true</tt> if this object is newly created and has <b>not</b> been loaded from the database, <tt>false</tt> otherwise */ public boolean isNew() { return this.__isNew; } /** Specify <tt>true</tt> to set this object's status as newly created (and not read from a database) */ protected void setNew(boolean val) { this.__isNew = val; } /** returns <tt>true</tt> if this object's data (for any field) has changed since it was created/loaded, <tt>false</tt> otherwise */ public boolean isModified() { return this.__isModified; } /** Resets the modified status of this object to not-modified this is useful when loading an object via a prepared statement (by using various setXXX methods when we do so, we inadvertently set the modified status of each field to true) */ void resetModified() { this.__isModified = false; this.__isModified_uid = false; this.__isModified_name = false; this.__isModified_email = false; this.__isModified_password = false; this.__isModified_created_on = false; this.__isModified_is_active = false; } /** Allows putting arbitrary object-specific data into this object. This is useful to store additional query-specific columns when performing arbitrary queries. For example: <blockquote><pre> String query = "select <font color=blue>1+1 as my_sum, now() as my_time</font>, mollytestMgr.columns() from mollytest"; PreparedStatement ps = con.prepareStatment(query); ResultSet rs = ps.executeQuery(); List list = new ArrayList(); while (rs.next()) { <font color=green>mollytest</font> obj = mollytestMgr.getFromRS(rs); obj.<font color=blue>putExtraData("my_sum"</font>, rs.getInt("my_sum")); obj.<font color=blue>putExtraData("my_time"</font>, rs.getDate("my_time")); } //use the list later on...each <font color=green>mollytest </font>object in the list will //have the extra data.. </pre></blockquote> */ public void putExtraData(Object key, Object value) { synchronized (this) { if (__extra_data == null) { __extra_data = new HashMap(); } } __extra_data.put(key, value); } /** Allows retrieving arbitrary object-specific data from this object. This data should have been put via the {@link #putExtraData putExtraData} method prior to invoking this method */ public Object getExtraData(Object key) { synchronized (this) { if (__extra_data == null) { return null; } } return __extra_data.get(key); } public String toString() { final String nl = fc.io.IOUtil.LINE_SEP; StringBuffer buf = new StringBuffer(256); buf.append("Class Name: [mollytest]"); buf.append(" [isDiscarded=").append(this.isDiscarded()).append("]"); buf.append(" [isNew=").append(this.isNew()).append("]"); buf.append(" [isModified=").append(this.isModified()).append("]"); buf.append(nl); buf.append("Note: IsNullInDB only meaningful for existing rows (i.e., isNew=false)"); buf.append(nl); ByteArrayOutputStream out = new ByteArrayOutputStream(768); TablePrinter.PrintConfig config = new TablePrinter.PrintConfig(); config.setPrintBorders(false); config.setCellSpacing(1); config.setCellPadding(0); config.setAutoFit(true); TablePrinter p = new TablePrinter(7, new PrintStream(out), config); p.startTable(); p.startRow(); p.printCell("PK"); p.printCell("FK"); p.printCell("Field"); p.printCell("Value"); p.printCell("isModified"); p.printCell("isNullinDB"); p.printCell("isSerial/AutoInc"); p.endRow(); p.startRow(); p.printCell("x"); p.printCell("-"); p.printCell("uid"); p.printCell(String.valueOf(this.uid)); p.printCell((this.__isModified_uid) ?"x":"-"); p.printCell((this.__isNullInDB_uid) ?"x":"-"); p.printCell("x"); p.endRow(); p.startRow(); p.printCell("-"); p.printCell("-"); p.printCell("name"); p.printCell(String.valueOf(this.name)); p.printCell((this.__isModified_name) ?"x":"-"); p.printCell((this.__isNullInDB_name) ?"x":"-"); p.printCell("-"); p.endRow(); p.startRow(); p.printCell("-"); p.printCell("-"); p.printCell("email"); p.printCell(String.valueOf(this.email)); p.printCell((this.__isModified_email) ?"x":"-"); p.printCell((this.__isNullInDB_email) ?"x":"-"); p.printCell("-"); p.endRow(); p.startRow(); p.printCell("-"); p.printCell("-"); p.printCell("password"); p.printCell(String.valueOf(this.password)); p.printCell((this.__isModified_password) ?"x":"-"); p.printCell((this.__isNullInDB_password) ?"x":"-"); p.printCell("-"); p.endRow(); p.startRow(); p.printCell("-"); p.printCell("-"); p.printCell("created_on"); p.printCell(String.valueOf(this.created_on)); p.printCell((this.__isModified_created_on) ?"x":"-"); p.printCell((this.__isNullInDB_created_on) ?"x":"-"); p.printCell("-"); p.endRow(); p.startRow(); p.printCell("-"); p.printCell("-"); p.printCell("is_active"); p.printCell(String.valueOf(this.is_active)); p.printCell((this.__isModified_is_active) ?"x":"-"); p.printCell((this.__isNullInDB_is_active) ?"x":"-"); p.printCell("-"); p.endRow(); p.endTable(); buf.append(out.toString()); return buf.toString(); } /* ============== Gets and Sets ============== */ /** serial (INTEGER); PK=yes; Nullable=false; AutoInc=true; MaxSize=10 */ public int get_uid() { return uid; } /** serial (INTEGER); PK=yes; Nullable=false; AutoInc=true; MaxSize=10 */ /* Generating set for set_uid with non public access since it's an auto-increment column */ mollytest set_uid(int uid) { this.uid = uid; this.__isModified_uid = true; this.__isModified = true; return this; } /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ public String get_name() { return name; } /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ public mollytest set_name(String name) { this.name = name; this.__isModified_name = true; this.__isModified = true; return this; } /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ public String get_email() { return email; } /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ public mollytest set_email(String email) { this.email = email; this.__isModified_email = true; this.__isModified = true; return this; } /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ public String get_password() { return password; } /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=99 */ public mollytest set_password(String password) { this.password = password; this.__isModified_password = true; this.__isModified = true; return this; } /** date (DATE); Nullable=true; AutoInc=false; MaxSize=13 */ public java.sql.Date get_created_on() { return created_on; } /** date (DATE); Nullable=true; AutoInc=false; MaxSize=13 */ public mollytest set_created_on(java.sql.Date created_on) { this.created_on = created_on; this.__isModified_created_on = true; this.__isModified = true; return this; } /** bool (BIT); Nullable=true; AutoInc=false; MaxSize=1 */ public boolean get_is_active() { return is_active; } /** bool (BIT); Nullable=true; AutoInc=false; MaxSize=1 */ public mollytest set_is_active(boolean is_active) { this.is_active = is_active; this.__isModified_is_active = true; this.__isModified = true; return this; } }