01: package simpleorm.core;
02:
03: import simpleorm.properties.*;
04: import java.sql.ResultSet;
05:
06: /** Represents Boolean field meta data as "Y" and "N" chars.
07: */
08: public class SFieldBooleanCharYN extends SFieldBooleanChar {
09: public SFieldBooleanCharYN(SRecordMeta meta, String columnName,
10: SPropertyValue[] pvals) {
11: super (meta, columnName, pvals);
12: putProperty(SCon.SBYTE_SIZE, new Integer(1)); // for Create Table only.
13: TRUE_VALUE = "Y";
14: FALSE_VALUE = "N";
15: }
16:
17: public SFieldBooleanCharYN(SRecordMeta meta, String columnName) {
18: this (meta, columnName, new SPropertyValue[0]);
19: }
20:
21: public SFieldBooleanCharYN(SRecordMeta meta, String columnName,
22: SPropertyValue pval) {
23: this (meta, columnName, new SPropertyValue[] { pval });
24: }
25:
26: public SFieldBooleanCharYN(SRecordMeta meta, String columnName,
27: SPropertyValue pval1, SPropertyValue pval2) {
28: this (meta, columnName, new SPropertyValue[] { pval1, pval2 });
29: }
30:
31: /** Abstract specializer. Clone this key field to be a foreign key
32: to <code>rmeta</code> of the same type.*/
33: SFieldMeta makeForeignKey(SRecordMeta rmeta, String prefix,
34: SPropertyValue[] pvals) {
35: return new SFieldBooleanCharYN(rmeta, (prefix == null ? ""
36: : prefix)
37: + getString(SCon.SCOLUMN_NAME), pvals);
38: }
39: }
|