001// Copyright (c) 2001 Hursh Jain (http://www.mollypages.org) 
002// The Molly framework is freely distributable under the terms of an
003// MIT-style license. For details, see the molly pages web site at:
004// http://www.mollypages.org/. Use, modify, have fun !
005
006package fc.jdbc.dbo.generated;
007
008/*
009 * Auto generated on: Wed May 18 15:51:41 EDT 2022
010 * JDBC url: [jdbc:postgresql://127.0.0.1/test]
011 * WARNING: Manual edits will be lost if/when this file is regenerated.
012 */
013import java.io.*;
014import java.math.*;
015import java.sql.*;
016import java.util.*;
017
018import fc.io.*;
019import fc.jdbc.*;
020import fc.jdbc.dbo.*;
021import fc.util.*;
022import fc.web.forms.*;
023
024/**
025Represents a row in the  alltypes table. 
026*/
027public class alltypes extends fc.jdbc.dbo.DBO
028{
029/* Default constructor */
030public alltypes()
031  {
032  this.__isNew  = true;
033  }
034
035/*--------------------- Columns ------------------------*/
036 private int            id;              /** serial (INTEGER); PK=yes; Nullable=false; AutoInc=true; MaxSize=10 */ 
037 private short          smallint_val;    /** int2 (SMALLINT); Nullable=true; AutoInc=false; MaxSize=5 */           
038 private int            int_val;         /** int4 (INTEGER); Nullable=false; AutoInc=false; MaxSize=10 */          
039 private long           bigint_val;      /** int8 (BIGINT); Nullable=true; AutoInc=false; MaxSize=19 */            
040 private float          float_val;       /** float4 (REAL); Nullable=true; AutoInc=false; MaxSize=8 */             
041 private double         double_val;      /** float8 (DOUBLE); Nullable=true; AutoInc=false; MaxSize=17 */          
042 private BigDecimal     numeric_val;     /** numeric (NUMERIC); Nullable=true; AutoInc=false; MaxSize=5 */         
043 private String         char_val;        /** bpchar (CHAR); Nullable=true; AutoInc=false; MaxSize=10 */            
044 private String         varchar_val;     /** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=10 */        
045 private String         longvarchar_val; /** text (VARCHAR); Nullable=true; AutoInc=false; MaxSize=2147483647 */   
046 private java.sql.Date  date_val;        /** date (DATE); Nullable=true; AutoInc=false; MaxSize=13 */              
047 private Time           time_val;        /** time (TIME); Nullable=true; AutoInc=false; MaxSize=15 */              
048 private Timestamp      timestamp_val;   /** timestamp (TIMESTAMP); Nullable=true; AutoInc=false; MaxSize=29 */    
049 private Boolean        bit_val;         /** bit (BIT); Nullable=true; AutoInc=false; MaxSize=1 */                 
050 private java.sql.Array array_val;       /** _varchar (ARRAY); Nullable=true; AutoInc=false; MaxSize=10 */         
051 private Boolean        boolean_val;     /** bool (BIT); Nullable=true; AutoInc=false; MaxSize=1 */                
052 private byte[]         varbinary_val;   /** bytea (BINARY); Nullable=true; AutoInc=false; MaxSize=2147483647 */   
053 private String         json_val;        /** json (OTHER); Nullable=true; AutoInc=false; MaxSize=2147483647 */     
054 private String         jsonb_val;       /** jsonb (OTHER); Nullable=true; AutoInc=false; MaxSize=2147483647 */    
055/*------------------------------------------------------*/
056/*
057Original PK saved here for updates. If a row is retrieved from the database and
058the PK value is changed, and then if the object is saved, we need the orignal PK
059value to find the row in the db for our update to work.
060*/
061int __orig_id;
062
063    boolean __force_update  = false;
064private Map   __extra_data;     
065private boolean __isNew     = false;
066private boolean __isModified  = false;
067
068private   boolean __isModified_id = false;
069protected boolean __isNullInDB_id = false;
070/**returns <tt>true</tt> if id has changed since it was created/loaded, <tt>false</tt> otherwise*/
071public boolean isModified_id() { return this.__isModified_id; }
072/**returns <tt>true</tt> if id was null in the database*/
073public boolean isNullInDB_id() { return this.__isNullInDB_id; }
074
075private   boolean __isModified_smallint_val = false;
076/* this primitive type is nullable, this tracks whether we should save it as null to the database*/
077private   boolean __isModified_smallint_val_setnull = false;
078protected boolean __isNullInDB_smallint_val = false;
079/**returns <tt>true</tt> if smallint_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
080public boolean isModified_smallint_val() { return this.__isModified_smallint_val; }
081/**returns <true> is primitive type smallint_val has been set to null via the setNull mechanism*/
082public boolean isModifiedSetNull_smallint_val() { return this.__isModified_smallint_val_setnull; }
083/**returns <tt>true</tt> if smallint_val was null in the database*/
084public boolean isNullInDB_smallint_val() { return this.__isNullInDB_smallint_val; }
085
086private   boolean __isModified_int_val = false;
087protected boolean __isNullInDB_int_val = false;
088/**returns <tt>true</tt> if int_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
089public boolean isModified_int_val() { return this.__isModified_int_val; }
090/**returns <tt>true</tt> if int_val was null in the database*/
091public boolean isNullInDB_int_val() { return this.__isNullInDB_int_val; }
092
093private   boolean __isModified_bigint_val = false;
094/* this primitive type is nullable, this tracks whether we should save it as null to the database*/
095private   boolean __isModified_bigint_val_setnull = false;
096protected boolean __isNullInDB_bigint_val = false;
097/**returns <tt>true</tt> if bigint_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
098public boolean isModified_bigint_val() { return this.__isModified_bigint_val; }
099/**returns <true> is primitive type bigint_val has been set to null via the setNull mechanism*/
100public boolean isModifiedSetNull_bigint_val() { return this.__isModified_bigint_val_setnull; }
101/**returns <tt>true</tt> if bigint_val was null in the database*/
102public boolean isNullInDB_bigint_val() { return this.__isNullInDB_bigint_val; }
103
104private   boolean __isModified_float_val = false;
105/* this primitive type is nullable, this tracks whether we should save it as null to the database*/
106private   boolean __isModified_float_val_setnull = false;
107protected boolean __isNullInDB_float_val = false;
108/**returns <tt>true</tt> if float_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
109public boolean isModified_float_val() { return this.__isModified_float_val; }
110/**returns <true> is primitive type float_val has been set to null via the setNull mechanism*/
111public boolean isModifiedSetNull_float_val() { return this.__isModified_float_val_setnull; }
112/**returns <tt>true</tt> if float_val was null in the database*/
113public boolean isNullInDB_float_val() { return this.__isNullInDB_float_val; }
114
115private   boolean __isModified_double_val = false;
116/* this primitive type is nullable, this tracks whether we should save it as null to the database*/
117private   boolean __isModified_double_val_setnull = false;
118protected boolean __isNullInDB_double_val = false;
119/**returns <tt>true</tt> if double_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
120public boolean isModified_double_val() { return this.__isModified_double_val; }
121/**returns <true> is primitive type double_val has been set to null via the setNull mechanism*/
122public boolean isModifiedSetNull_double_val() { return this.__isModified_double_val_setnull; }
123/**returns <tt>true</tt> if double_val was null in the database*/
124public boolean isNullInDB_double_val() { return this.__isNullInDB_double_val; }
125
126private   boolean __isModified_numeric_val = false;
127protected boolean __isNullInDB_numeric_val = false;
128/**returns <tt>true</tt> if numeric_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
129public boolean isModified_numeric_val() { return this.__isModified_numeric_val; }
130/**returns <tt>true</tt> if numeric_val was null in the database*/
131public boolean isNullInDB_numeric_val() { return this.__isNullInDB_numeric_val; }
132
133private   boolean __isModified_char_val = false;
134protected boolean __isNullInDB_char_val = false;
135/**returns <tt>true</tt> if char_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
136public boolean isModified_char_val() { return this.__isModified_char_val; }
137/**returns <tt>true</tt> if char_val was null in the database*/
138public boolean isNullInDB_char_val() { return this.__isNullInDB_char_val; }
139
140private   boolean __isModified_varchar_val = false;
141protected boolean __isNullInDB_varchar_val = false;
142/**returns <tt>true</tt> if varchar_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
143public boolean isModified_varchar_val() { return this.__isModified_varchar_val; }
144/**returns <tt>true</tt> if varchar_val was null in the database*/
145public boolean isNullInDB_varchar_val() { return this.__isNullInDB_varchar_val; }
146
147private   boolean __isModified_longvarchar_val = false;
148protected boolean __isNullInDB_longvarchar_val = false;
149/**returns <tt>true</tt> if longvarchar_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
150public boolean isModified_longvarchar_val() { return this.__isModified_longvarchar_val; }
151/**returns <tt>true</tt> if longvarchar_val was null in the database*/
152public boolean isNullInDB_longvarchar_val() { return this.__isNullInDB_longvarchar_val; }
153
154private   boolean __isModified_date_val = false;
155protected boolean __isNullInDB_date_val = false;
156/**returns <tt>true</tt> if date_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
157public boolean isModified_date_val() { return this.__isModified_date_val; }
158/**returns <tt>true</tt> if date_val was null in the database*/
159public boolean isNullInDB_date_val() { return this.__isNullInDB_date_val; }
160
161private   boolean __isModified_time_val = false;
162protected boolean __isNullInDB_time_val = false;
163/**returns <tt>true</tt> if time_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
164public boolean isModified_time_val() { return this.__isModified_time_val; }
165/**returns <tt>true</tt> if time_val was null in the database*/
166public boolean isNullInDB_time_val() { return this.__isNullInDB_time_val; }
167
168private   boolean __isModified_timestamp_val = false;
169protected boolean __isNullInDB_timestamp_val = false;
170/**returns <tt>true</tt> if timestamp_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
171public boolean isModified_timestamp_val() { return this.__isModified_timestamp_val; }
172/**returns <tt>true</tt> if timestamp_val was null in the database*/
173public boolean isNullInDB_timestamp_val() { return this.__isNullInDB_timestamp_val; }
174
175private   boolean __isModified_bit_val = false;
176protected boolean __isNullInDB_bit_val = false;
177/**returns <tt>true</tt> if bit_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
178public boolean isModified_bit_val() { return this.__isModified_bit_val; }
179/**returns <tt>true</tt> if bit_val was null in the database*/
180public boolean isNullInDB_bit_val() { return this.__isNullInDB_bit_val; }
181
182private   boolean __isModified_array_val = false;
183protected boolean __isNullInDB_array_val = false;
184/**returns <tt>true</tt> if array_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
185public boolean isModified_array_val() { return this.__isModified_array_val; }
186/**returns <tt>true</tt> if array_val was null in the database*/
187public boolean isNullInDB_array_val() { return this.__isNullInDB_array_val; }
188
189private   boolean __isModified_boolean_val = false;
190protected boolean __isNullInDB_boolean_val = false;
191/**returns <tt>true</tt> if boolean_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
192public boolean isModified_boolean_val() { return this.__isModified_boolean_val; }
193/**returns <tt>true</tt> if boolean_val was null in the database*/
194public boolean isNullInDB_boolean_val() { return this.__isNullInDB_boolean_val; }
195
196private   boolean __isModified_varbinary_val = false;
197protected boolean __isNullInDB_varbinary_val = false;
198/**returns <tt>true</tt> if varbinary_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
199public boolean isModified_varbinary_val() { return this.__isModified_varbinary_val; }
200/**returns <tt>true</tt> if varbinary_val was null in the database*/
201public boolean isNullInDB_varbinary_val() { return this.__isNullInDB_varbinary_val; }
202
203private   boolean __isModified_json_val = false;
204protected boolean __isNullInDB_json_val = false;
205/**returns <tt>true</tt> if json_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
206public boolean isModified_json_val() { return this.__isModified_json_val; }
207/**returns <tt>true</tt> if json_val was null in the database*/
208public boolean isNullInDB_json_val() { return this.__isNullInDB_json_val; }
209
210private   boolean __isModified_jsonb_val = false;
211protected boolean __isNullInDB_jsonb_val = false;
212/**returns <tt>true</tt> if jsonb_val has changed since it was created/loaded, <tt>false</tt> otherwise*/
213public boolean isModified_jsonb_val() { return this.__isModified_jsonb_val; }
214/**returns <tt>true</tt> if jsonb_val was null in the database*/
215public boolean isNullInDB_jsonb_val() { return this.__isNullInDB_jsonb_val; }
216
217
218/** returns <tt>true</tt> if this object is newly created and has <b>not</b> been loaded from the database, <tt>false</tt> otherwise */
219public boolean isNew() 
220  {
221  return this.__isNew;
222  }
223
224/** Specify <tt>true</tt> to set this object's status as newly created (and not read from a database) */
225protected void setNew(boolean val) 
226  {
227  this.__isNew = val;
228  }
229
230/** returns <tt>true</tt> if this object's data (for any field) has changed since it was created/loaded, <tt>false</tt> otherwise */
231public boolean isModified() 
232  {
233  return this.__isModified;
234  }
235
236/** Resets the modified status of this object to not-modified
237this is useful when loading an object via a prepared statement
238(by using various setXXX methods when we do so, we inadvertently
239set the modified status of each field to true)
240*/
241void resetModified() 
242  {
243  this.__isModified = false;
244  this.__isModified_id = false;
245  this.__isModified_smallint_val = false;
246  this.__isModified_smallint_val_setnull = false;
247  this.__isModified_int_val = false;
248  this.__isModified_bigint_val = false;
249  this.__isModified_bigint_val_setnull = false;
250  this.__isModified_float_val = false;
251  this.__isModified_float_val_setnull = false;
252  this.__isModified_double_val = false;
253  this.__isModified_double_val_setnull = false;
254  this.__isModified_numeric_val = false;
255  this.__isModified_char_val = false;
256  this.__isModified_varchar_val = false;
257  this.__isModified_longvarchar_val = false;
258  this.__isModified_date_val = false;
259  this.__isModified_time_val = false;
260  this.__isModified_timestamp_val = false;
261  this.__isModified_bit_val = false;
262  this.__isModified_array_val = false;
263  this.__isModified_boolean_val = false;
264  this.__isModified_varbinary_val = false;
265  this.__isModified_json_val = false;
266  this.__isModified_jsonb_val = false;
267  }
268
269/**
270Allows putting arbitrary object-specific data into this object.
271This is useful to store additional query-specific columns when performing
272arbitrary queries. For example: 
273<blockquote><pre>
274String query = "select <font color=blue>1+1 as my_sum, 
275    now() as my_time</font>, alltypesMgr.columns() 
276    from alltypes";
277PreparedStatement ps = con.prepareStatment(query);
278ResultSet rs = ps.executeQuery();
279List list = new ArrayList();
280while (rs.next()) {
281  <font color=green>alltypes</font> obj = alltypesMgr.getFromRS(rs);
282  obj.<font color=blue>putExtraData("my_sum"</font>, rs.getInt("my_sum"));
283  obj.<font color=blue>putExtraData("my_time"</font>, rs.getDate("my_time"));
284  }
285//use the list later on...each <font color=green>alltypes </font>object in the list will 
286//have the extra data..
287</pre></blockquote>
288*/
289public void putExtraData(Object key, Object value) 
290  {
291  synchronized (this) {
292    if (__extra_data == null) {
293      __extra_data = new HashMap();
294      }
295    }
296  __extra_data.put(key, value);
297  }
298/*Alias for the {@link putExtraData} method */
299public void put(Object key, Object value) 
300  {
301  putExtraData(key, value);
302  }
303
304/**
305Allows retrieving arbitrary object-specific data from this object.
306This data should have been put via the {@link #putExtraData putExtraData} 
307method prior to invoking this method
308*/
309public Object getExtraData(Object key) 
310  {
311  synchronized (this) {
312    if (__extra_data == null) {
313      return null;
314      }
315    }
316  return __extra_data.get(key);
317  }
318/*Alias for the {@link getExtraData} method */
319public Object get(Object key) 
320  {
321  return getExtraData(key);
322  }
323
324public String toString() 
325  {
326  final String nl = fc.io.IOUtil.LINE_SEP;
327  StringBuffer buf = new StringBuffer(256);
328  buf.append("Class Name: [alltypes]");
329  buf.append(" [isDiscarded=").append(this.isDiscarded()).append("]");
330  buf.append(" [isNew=").append(this.isNew()).append("]");
331  buf.append(" [isModified=").append(this.isModified()).append("]");
332  buf.append(nl);
333  buf.append("Note: IsNullInDB only meaningful for existing rows (i.e., isNew=false)");
334  buf.append(nl);
335
336  ByteArrayOutputStream out = new ByteArrayOutputStream(768);
337  TablePrinter.PrintConfig config = new TablePrinter.PrintConfig();
338  config.setPrintBorders(false);
339  config.setCellSpacing(1);
340  config.setCellPadding(0);
341  config.setAutoFit(true);
342  TablePrinter p = new TablePrinter(7, new PrintStream(out), config);
343  p.startTable();
344
345  p.startRow();
346  p.printCell("PK");
347  p.printCell("FK");
348  p.printCell("Field");
349  p.printCell("Value");
350  p.printCell("isModified");
351  p.printCell("isNullinDB");
352  p.printCell("isSerial/AutoInc");
353  p.endRow();
354
355  p.startRow();
356  p.printCell("x");
357  p.printCell("-");
358  p.printCell("id");
359  p.printCell(String.valueOf(this.id));
360  p.printCell((this.__isModified_id) ?"x":"-");
361  p.printCell((this.__isNullInDB_id) ?"x":"-");
362  p.printCell("x");
363  p.endRow();
364
365  p.startRow();
366  p.printCell("-");
367  p.printCell("-");
368  p.printCell("smallint_val");
369  p.printCell(String.valueOf(this.smallint_val));
370  p.printCell((this.__isModified_smallint_val) ?"x":"-");
371  p.printCell((this.__isNullInDB_smallint_val) ?"x":"-");
372  p.printCell("-");
373  p.endRow();
374
375  p.startRow();
376  p.printCell("-");
377  p.printCell("-");
378  p.printCell("int_val");
379  p.printCell(String.valueOf(this.int_val));
380  p.printCell((this.__isModified_int_val) ?"x":"-");
381  p.printCell((this.__isNullInDB_int_val) ?"x":"-");
382  p.printCell("-");
383  p.endRow();
384
385  p.startRow();
386  p.printCell("-");
387  p.printCell("-");
388  p.printCell("bigint_val");
389  p.printCell(String.valueOf(this.bigint_val));
390  p.printCell((this.__isModified_bigint_val) ?"x":"-");
391  p.printCell((this.__isNullInDB_bigint_val) ?"x":"-");
392  p.printCell("-");
393  p.endRow();
394
395  p.startRow();
396  p.printCell("-");
397  p.printCell("-");
398  p.printCell("float_val");
399  p.printCell(String.valueOf(this.float_val));
400  p.printCell((this.__isModified_float_val) ?"x":"-");
401  p.printCell((this.__isNullInDB_float_val) ?"x":"-");
402  p.printCell("-");
403  p.endRow();
404
405  p.startRow();
406  p.printCell("-");
407  p.printCell("-");
408  p.printCell("double_val");
409  p.printCell(String.valueOf(this.double_val));
410  p.printCell((this.__isModified_double_val) ?"x":"-");
411  p.printCell((this.__isNullInDB_double_val) ?"x":"-");
412  p.printCell("-");
413  p.endRow();
414
415  p.startRow();
416  p.printCell("-");
417  p.printCell("-");
418  p.printCell("numeric_val");
419  p.printCell(String.valueOf(this.numeric_val));
420  p.printCell((this.__isModified_numeric_val) ?"x":"-");
421  p.printCell((this.__isNullInDB_numeric_val) ?"x":"-");
422  p.printCell("-");
423  p.endRow();
424
425  p.startRow();
426  p.printCell("-");
427  p.printCell("-");
428  p.printCell("char_val");
429  p.printCell(String.valueOf(this.char_val));
430  p.printCell((this.__isModified_char_val) ?"x":"-");
431  p.printCell((this.__isNullInDB_char_val) ?"x":"-");
432  p.printCell("-");
433  p.endRow();
434
435  p.startRow();
436  p.printCell("-");
437  p.printCell("-");
438  p.printCell("varchar_val");
439  p.printCell(String.valueOf(this.varchar_val));
440  p.printCell((this.__isModified_varchar_val) ?"x":"-");
441  p.printCell((this.__isNullInDB_varchar_val) ?"x":"-");
442  p.printCell("-");
443  p.endRow();
444
445  p.startRow();
446  p.printCell("-");
447  p.printCell("-");
448  p.printCell("longvarchar_val");
449  p.printCell(String.valueOf(this.longvarchar_val));
450  p.printCell((this.__isModified_longvarchar_val) ?"x":"-");
451  p.printCell((this.__isNullInDB_longvarchar_val) ?"x":"-");
452  p.printCell("-");
453  p.endRow();
454
455  p.startRow();
456  p.printCell("-");
457  p.printCell("-");
458  p.printCell("date_val");
459  p.printCell(String.valueOf(this.date_val));
460  p.printCell((this.__isModified_date_val) ?"x":"-");
461  p.printCell((this.__isNullInDB_date_val) ?"x":"-");
462  p.printCell("-");
463  p.endRow();
464
465  p.startRow();
466  p.printCell("-");
467  p.printCell("-");
468  p.printCell("time_val");
469  p.printCell(String.valueOf(this.time_val));
470  p.printCell((this.__isModified_time_val) ?"x":"-");
471  p.printCell((this.__isNullInDB_time_val) ?"x":"-");
472  p.printCell("-");
473  p.endRow();
474
475  p.startRow();
476  p.printCell("-");
477  p.printCell("-");
478  p.printCell("timestamp_val");
479  p.printCell(String.valueOf(this.timestamp_val));
480  p.printCell((this.__isModified_timestamp_val) ?"x":"-");
481  p.printCell((this.__isNullInDB_timestamp_val) ?"x":"-");
482  p.printCell("-");
483  p.endRow();
484
485  p.startRow();
486  p.printCell("-");
487  p.printCell("-");
488  p.printCell("bit_val");
489  p.printCell(String.valueOf(this.bit_val));
490  p.printCell((this.__isModified_bit_val) ?"x":"-");
491  p.printCell((this.__isNullInDB_bit_val) ?"x":"-");
492  p.printCell("-");
493  p.endRow();
494
495  p.startRow();
496  p.printCell("-");
497  p.printCell("-");
498  p.printCell("array_val");
499  p.printCell(String.valueOf(this.array_val));
500  p.printCell((this.__isModified_array_val) ?"x":"-");
501  p.printCell((this.__isNullInDB_array_val) ?"x":"-");
502  p.printCell("-");
503  p.endRow();
504
505  p.startRow();
506  p.printCell("-");
507  p.printCell("-");
508  p.printCell("boolean_val");
509  p.printCell(String.valueOf(this.boolean_val));
510  p.printCell((this.__isModified_boolean_val) ?"x":"-");
511  p.printCell((this.__isNullInDB_boolean_val) ?"x":"-");
512  p.printCell("-");
513  p.endRow();
514
515  p.startRow();
516  p.printCell("-");
517  p.printCell("-");
518  p.printCell("varbinary_val");
519  p.printCell(String.valueOf(this.varbinary_val));
520  p.printCell((this.__isModified_varbinary_val) ?"x":"-");
521  p.printCell((this.__isNullInDB_varbinary_val) ?"x":"-");
522  p.printCell("-");
523  p.endRow();
524
525  p.startRow();
526  p.printCell("-");
527  p.printCell("-");
528  p.printCell("json_val");
529  p.printCell(String.valueOf(this.json_val));
530  p.printCell((this.__isModified_json_val) ?"x":"-");
531  p.printCell((this.__isNullInDB_json_val) ?"x":"-");
532  p.printCell("-");
533  p.endRow();
534
535  p.startRow();
536  p.printCell("-");
537  p.printCell("-");
538  p.printCell("jsonb_val");
539  p.printCell(String.valueOf(this.jsonb_val));
540  p.printCell((this.__isModified_jsonb_val) ?"x":"-");
541  p.printCell((this.__isNullInDB_jsonb_val) ?"x":"-");
542  p.printCell("-");
543  p.endRow();
544
545  p.endTable();
546  buf.append(out.toString());
547  return buf.toString();
548  }
549
550/**
551Returns a map of all fields-&gt;values (as Strings) contained in this
552object. This is useful when sending auto converting the object to JSON, etc.
553*/
554public Map allFieldsMap() 
555  {
556  final HashMap m = new HashMap();
557  m.put("id", String.valueOf(this.id));
558  m.put("smallint_val", 
559    ( __isModified_smallint_val ? 
560      ( __isModified_smallint_val_setnull ? null : String.valueOf(this.smallint_val) ) : 
561      ( __isNullInDB_smallint_val ? null : String.valueOf(this.smallint_val))));
562  m.put("int_val", String.valueOf(this.int_val));
563  m.put("bigint_val", 
564    ( __isModified_bigint_val ? 
565      ( __isModified_bigint_val_setnull ? null : String.valueOf(this.bigint_val) ) : 
566      ( __isNullInDB_bigint_val ? null : String.valueOf(this.bigint_val))));
567  m.put("float_val", 
568    ( __isModified_float_val ? 
569      ( __isModified_float_val_setnull ? null : String.valueOf(this.float_val) ) : 
570      ( __isNullInDB_float_val ? null : String.valueOf(this.float_val))));
571  m.put("double_val", 
572    ( __isModified_double_val ? 
573      ( __isModified_double_val_setnull ? null : String.valueOf(this.double_val) ) : 
574      ( __isNullInDB_double_val ? null : String.valueOf(this.double_val))));
575  m.put("numeric_val", (numeric_val == null ? null : String.valueOf(this.numeric_val)));
576  m.put("char_val", (char_val == null ? null : String.valueOf(this.char_val)));
577  m.put("varchar_val", (varchar_val == null ? null : String.valueOf(this.varchar_val)));
578  m.put("longvarchar_val", (longvarchar_val == null ? null : String.valueOf(this.longvarchar_val)));
579  m.put("date_val", (date_val == null ? null : String.valueOf(this.date_val)));
580  m.put("time_val", (time_val == null ? null : String.valueOf(this.time_val)));
581  m.put("timestamp_val", (timestamp_val == null ? null : String.valueOf(this.timestamp_val)));
582  m.put("bit_val", (bit_val == null ? null : String.valueOf(this.bit_val)));
583  m.put("array_val", (array_val == null ? null : String.valueOf(this.array_val)));
584  m.put("boolean_val", (boolean_val == null ? null : String.valueOf(this.boolean_val)));
585  m.put("varbinary_val", (varbinary_val == null ? null : String.valueOf(this.varbinary_val)));
586  m.put("json_val", (json_val == null ? null : String.valueOf(this.json_val)));
587  m.put("jsonb_val", (jsonb_val == null ? null : String.valueOf(this.jsonb_val)));
588  return m;
589  }
590
591/* ============== Gets and Sets ============== */
592
593/** serial (INTEGER); PK=yes; Nullable=false; AutoInc=true; MaxSize=10 */
594public int get_id()  { 
595  return id;
596  }
597
598/** serial (INTEGER); PK=yes; Nullable=false; AutoInc=true; MaxSize=10 */
599/* Generating set for set_id with non public access since it's an auto-increment column */
600 alltypes set_id(int id)  {
601  this.id = id;
602  this.__isModified_id = true;
603  this.__isModified = true;
604  return this;
605  }
606
607/** int2 (SMALLINT); Nullable=true; AutoInc=false; MaxSize=5 */
608public short get_smallint_val()  { 
609  return smallint_val;
610  }
611
612/** int2 (SMALLINT); Nullable=true; AutoInc=false; MaxSize=5 */
613public alltypes set_smallint_val(short smallint_val)  {
614  this.smallint_val = smallint_val;
615  this.__isModified_smallint_val = true;
616  this.__isModified = true;
617  return this;
618  }
619public alltypes setNull_smallint_val()
620  {
621  this.__isModified_smallint_val = true;
622  this.__isModified_smallint_val_setnull = true;
623  this.__isModified = true;
624  return this;
625  }
626
627/** int4 (INTEGER); Nullable=false; AutoInc=false; MaxSize=10 */
628public int get_int_val()  { 
629  return int_val;
630  }
631
632/** int4 (INTEGER); Nullable=false; AutoInc=false; MaxSize=10 */
633public alltypes set_int_val(int int_val)  {
634  this.int_val = int_val;
635  this.__isModified_int_val = true;
636  this.__isModified = true;
637  return this;
638  }
639
640/** int8 (BIGINT); Nullable=true; AutoInc=false; MaxSize=19 */
641public long get_bigint_val()  { 
642  return bigint_val;
643  }
644
645/** int8 (BIGINT); Nullable=true; AutoInc=false; MaxSize=19 */
646public alltypes set_bigint_val(long bigint_val) {
647  this.bigint_val = bigint_val;
648  this.__isModified_bigint_val = true;
649  this.__isModified = true;
650  return this;
651  }
652public alltypes setNull_bigint_val()
653  {
654  this.__isModified_bigint_val = true;
655  this.__isModified_bigint_val_setnull = true;
656  this.__isModified = true;
657  return this;
658  }
659
660/** float4 (REAL); Nullable=true; AutoInc=false; MaxSize=8 */
661public float get_float_val()  { 
662  return float_val;
663  }
664
665/** float4 (REAL); Nullable=true; AutoInc=false; MaxSize=8 */
666public alltypes set_float_val(float float_val)  {
667  this.float_val = float_val;
668  this.__isModified_float_val = true;
669  this.__isModified = true;
670  return this;
671  }
672public alltypes setNull_float_val()
673  {
674  this.__isModified_float_val = true;
675  this.__isModified_float_val_setnull = true;
676  this.__isModified = true;
677  return this;
678  }
679
680/** float8 (DOUBLE); Nullable=true; AutoInc=false; MaxSize=17 */
681public double get_double_val()  { 
682  return double_val;
683  }
684
685/** float8 (DOUBLE); Nullable=true; AutoInc=false; MaxSize=17 */
686public alltypes set_double_val(double double_val) {
687  this.double_val = double_val;
688  this.__isModified_double_val = true;
689  this.__isModified = true;
690  return this;
691  }
692public alltypes setNull_double_val()
693  {
694  this.__isModified_double_val = true;
695  this.__isModified_double_val_setnull = true;
696  this.__isModified = true;
697  return this;
698  }
699
700/** numeric (NUMERIC); Nullable=true; AutoInc=false; MaxSize=5 */
701public BigDecimal get_numeric_val()  { 
702  return numeric_val;
703  }
704
705/** numeric (NUMERIC); Nullable=true; AutoInc=false; MaxSize=5 */
706public alltypes set_numeric_val(BigDecimal numeric_val) {
707  this.numeric_val = numeric_val;
708  this.__isModified_numeric_val = true;
709  this.__isModified = true;
710  return this;
711  }
712
713/** bpchar (CHAR); Nullable=true; AutoInc=false; MaxSize=10 */
714public String get_char_val()  { 
715  return char_val;
716  }
717
718/** bpchar (CHAR); Nullable=true; AutoInc=false; MaxSize=10 */
719public alltypes set_char_val(String char_val) {
720  this.char_val = char_val;
721  this.__isModified_char_val = true;
722  this.__isModified = true;
723  return this;
724  }
725
726/** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=10 */
727public String get_varchar_val()  { 
728  return varchar_val;
729  }
730
731/** varchar (VARCHAR); Nullable=true; AutoInc=false; MaxSize=10 */
732public alltypes set_varchar_val(String varchar_val) {
733  this.varchar_val = varchar_val;
734  this.__isModified_varchar_val = true;
735  this.__isModified = true;
736  return this;
737  }
738
739/** text (VARCHAR); Nullable=true; AutoInc=false; MaxSize=2147483647 */
740public String get_longvarchar_val()  { 
741  return longvarchar_val;
742  }
743
744/** text (VARCHAR); Nullable=true; AutoInc=false; MaxSize=2147483647 */
745public alltypes set_longvarchar_val(String longvarchar_val) {
746  this.longvarchar_val = longvarchar_val;
747  this.__isModified_longvarchar_val = true;
748  this.__isModified = true;
749  return this;
750  }
751
752/** date (DATE); Nullable=true; AutoInc=false; MaxSize=13 */
753public java.sql.Date get_date_val()  { 
754  return date_val;
755  }
756
757/** date (DATE); Nullable=true; AutoInc=false; MaxSize=13 */
758public alltypes set_date_val(java.sql.Date date_val)  {
759  this.date_val = date_val;
760  this.__isModified_date_val = true;
761  this.__isModified = true;
762  return this;
763  }
764
765/** time (TIME); Nullable=true; AutoInc=false; MaxSize=15 */
766public Time get_time_val()  { 
767  return time_val;
768  }
769
770/** time (TIME); Nullable=true; AutoInc=false; MaxSize=15 */
771public alltypes set_time_val(Time time_val) {
772  this.time_val = time_val;
773  this.__isModified_time_val = true;
774  this.__isModified = true;
775  return this;
776  }
777
778/** timestamp (TIMESTAMP); Nullable=true; AutoInc=false; MaxSize=29 */
779public Timestamp get_timestamp_val()  { 
780  return timestamp_val;
781  }
782
783/** timestamp (TIMESTAMP); Nullable=true; AutoInc=false; MaxSize=29 */
784public alltypes set_timestamp_val(Timestamp timestamp_val)  {
785  this.timestamp_val = timestamp_val;
786  this.__isModified_timestamp_val = true;
787  this.__isModified = true;
788  return this;
789  }
790
791/** bit (BIT); Nullable=true; AutoInc=false; MaxSize=1 */
792public Boolean get_bit_val()  { 
793  return bit_val;
794  }
795
796/** bit (BIT); Nullable=true; AutoInc=false; MaxSize=1 */
797public alltypes set_bit_val(Boolean bit_val)  {
798  this.bit_val = bit_val;
799  this.__isModified_bit_val = true;
800  this.__isModified = true;
801  return this;
802  }
803
804/** _varchar (ARRAY); Nullable=true; AutoInc=false; MaxSize=10 */
805public java.sql.Array get_array_val()  { 
806  return array_val;
807  }
808
809/** _varchar (ARRAY); Nullable=true; AutoInc=false; MaxSize=10 */
810public alltypes set_array_val(java.sql.Array array_val) {
811  this.array_val = array_val;
812  this.__isModified_array_val = true;
813  this.__isModified = true;
814  return this;
815  }
816
817/** bool (BIT); Nullable=true; AutoInc=false; MaxSize=1 */
818public Boolean get_boolean_val()  { 
819  return boolean_val;
820  }
821
822/** bool (BIT); Nullable=true; AutoInc=false; MaxSize=1 */
823public alltypes set_boolean_val(Boolean boolean_val)  {
824  this.boolean_val = boolean_val;
825  this.__isModified_boolean_val = true;
826  this.__isModified = true;
827  return this;
828  }
829
830/** bytea (BINARY); Nullable=true; AutoInc=false; MaxSize=2147483647 */
831public byte[] get_varbinary_val()  { 
832  return varbinary_val;
833  }
834
835/** bytea (BINARY); Nullable=true; AutoInc=false; MaxSize=2147483647 */
836public alltypes set_varbinary_val(byte[] varbinary_val) {
837  this.varbinary_val = varbinary_val;
838  this.__isModified_varbinary_val = true;
839  this.__isModified = true;
840  return this;
841  }
842
843/** json (OTHER); Nullable=true; AutoInc=false; MaxSize=2147483647 */
844public String get_json_val()  { 
845  return json_val;
846  }
847
848/** json (OTHER); Nullable=true; AutoInc=false; MaxSize=2147483647 */
849public alltypes set_json_val(String json_val) {
850  this.json_val = json_val;
851  this.__isModified_json_val = true;
852  this.__isModified = true;
853  return this;
854  }
855
856/** jsonb (OTHER); Nullable=true; AutoInc=false; MaxSize=2147483647 */
857public String get_jsonb_val()  { 
858  return jsonb_val;
859  }
860
861/** jsonb (OTHER); Nullable=true; AutoInc=false; MaxSize=2147483647 */
862public alltypes set_jsonb_val(String jsonb_val) {
863  this.jsonb_val = jsonb_val;
864  this.__isModified_jsonb_val = true;
865  this.__isModified = true;
866  return this;
867  }
868
869/* =========== Increments / Decrements =========== */
870
871/** Increments int_val by 1 */
872public alltypes inc_int_val() {
873  this.int_val = this.int_val + 1;
874  this.__isModified_int_val = true;
875  this.__isModified = true;
876  return this;
877  }
878
879/** Increments int_val by the specified amount */
880public alltypes inc_int_val(int amount) {
881  this.int_val = this.int_val + amount;
882  this.__isModified_int_val = true;
883  this.__isModified = true;
884  return this;
885  }
886
887/** Increments int_val by the specified amount, upto but not above the upper bound (bound is inclusive) */
888public alltypes inc_int_val(int amount, int upper_bound) {
889  this.int_val = Math.min(this.int_val + amount, upper_bound);
890  this.__isModified_int_val = true;
891  this.__isModified = true;
892  return this;
893  }
894
895/** Decrements int_val by 1 */
896public alltypes dec_int_val() {
897  this.int_val = this.int_val - 1;
898  this.__isModified_int_val = true;
899  this.__isModified = true;
900  return this;
901  }
902
903/** Decrements int_val by the specified amount */
904public alltypes dec_int_val(int amount) {
905  this.int_val = this.int_val - amount;
906  this.__isModified_int_val = true;
907  this.__isModified = true;
908  return this;
909  }
910
911/** Decrements int_val by the specified amount, upto but not below the lower bound (bound is inclusive) */
912public alltypes dec_int_val(int amount, int lower_bound) {
913  this.int_val = Math.max(this.int_val - amount, lower_bound);
914  this.__isModified_int_val = true;
915  this.__isModified = true;
916  return this;
917  }
918
919/** Increments bigint_val by 1 */
920public alltypes inc_bigint_val() {
921  this.bigint_val = this.bigint_val + 1;
922  this.__isModified_bigint_val = true;
923  this.__isModified = true;
924  return this;
925  }
926
927/** Increments bigint_val by the specified amount */
928public alltypes inc_bigint_val(long amount) {
929  this.bigint_val = this.bigint_val + amount;
930  this.__isModified_bigint_val = true;
931  this.__isModified = true;
932  return this;
933  }
934
935/** Increments bigint_val by the specified amount, upto but not above the upper bound (bound is inclusive) */
936public alltypes inc_bigint_val(long amount, int upper_bound) {
937  this.bigint_val = Math.min(this.bigint_val + amount, upper_bound);
938  this.__isModified_bigint_val = true;
939  this.__isModified = true;
940  return this;
941  }
942
943/** Decrements bigint_val by 1 */
944public alltypes dec_bigint_val() {
945  this.bigint_val = this.bigint_val - 1;
946  this.__isModified_bigint_val = true;
947  this.__isModified = true;
948  return this;
949  }
950
951/** Decrements bigint_val by the specified amount */
952public alltypes dec_bigint_val(long amount) {
953  this.bigint_val = this.bigint_val - amount;
954  this.__isModified_bigint_val = true;
955  this.__isModified = true;
956  return this;
957  }
958
959/** Decrements bigint_val by the specified amount, upto but not below the lower bound (bound is inclusive) */
960public alltypes dec_bigint_val(long amount, int lower_bound) {
961  this.bigint_val = Math.max(this.bigint_val - amount, lower_bound);
962  this.__isModified_bigint_val = true;
963  this.__isModified = true;
964  return this;
965  }
966}