summaryrefslogtreecommitdiff
path: root/connectivity/qa
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2006-07-10 13:17:55 +0000
committerOliver Bolte <obo@openoffice.org>2006-07-10 13:17:55 +0000
commit5916a8acd8035629b978a27f1218ce61a6562360 (patch)
treed9d19b6f62eb8450baa77106123b4797aa9cbad9 /connectivity/qa
parentacf65359c2882391d3b9545a348928209e8249f3 (diff)
INTEGRATION: CWS qiq (1.2.54); FILE MERGED
2006/06/29 10:16:42 fs 1.2.54.1: support for foreign keys
Diffstat (limited to 'connectivity/qa')
-rw-r--r--connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java48
1 files changed, 35 insertions, 13 deletions
diff --git a/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java b/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java
index d1f7e7b56e88..4c8123dea238 100644
--- a/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java
+++ b/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java
@@ -4,9 +4,9 @@
*
* $RCSfile: HsqlColumnDescriptor.java,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: rt $ $Date: 2006-02-06 16:43:01 $
+ * last change: $Author: obo $ $Date: 2006-07-10 14:17:55 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -39,32 +39,54 @@ package connectivity.tools;
*/
public class HsqlColumnDescriptor
{
- public String Name;
- public String TypeName;
- public boolean NotNull;
- public boolean PrimaryKey;
+ private String Name;
+ private String TypeName;
+ private boolean Required;
+ private boolean PrimaryKey;
+ private String ForeignTable;
+ private String ForeignColumn;
+
+ public final String getName() { return Name; }
+ public final String getTypeName() { return TypeName; }
+ public final boolean isRequired() { return Required; }
+ public final boolean isPrimaryKey() { return PrimaryKey; }
+
+ public final boolean isForeignKey() { return ( ForeignTable.length() != 0 ) && ( ForeignColumn.length() != 0 ); }
+ public final String getForeignTable() { return ForeignTable; }
+ public final String getForeignColumn() { return ForeignColumn; }
+
+ /// determines that a column is required, i.e. not nullable
+ public final static int REQUIRED = 1;
+ /// determines that a column is part of the primary key of its table
+ public final static int PRIMARY = 2;
public HsqlColumnDescriptor( String _Name, String _TypeName )
{
Name = _Name;
TypeName = _TypeName;
- NotNull = false;
+ Required = false;
PrimaryKey = false;
+ ForeignTable = "";
+ ForeignColumn = "";
}
- public HsqlColumnDescriptor( String _Name, String _TypeName, boolean _NotNull )
+ public HsqlColumnDescriptor( String _Name, String _TypeName, int _Flags )
{
Name = _Name;
TypeName = _TypeName;
- NotNull = _NotNull;
- PrimaryKey = false;
+ Required = ( _Flags & REQUIRED ) != 0;
+ PrimaryKey = ( _Flags & PRIMARY ) != 0;
+ ForeignTable = "";
+ ForeignColumn = "";
}
- public HsqlColumnDescriptor( String _Name, String _TypeName, boolean _NotNull, boolean _PrimaryKey )
+ public HsqlColumnDescriptor( String _Name, String _TypeName, int _Flags, String _ForeignTable, String _ForeignColumn )
{
Name = _Name;
TypeName = _TypeName;
- NotNull = _NotNull;
- PrimaryKey = _PrimaryKey;
+ Required = ( _Flags & REQUIRED ) != 0;
+ PrimaryKey = ( _Flags & PRIMARY ) != 0;
+ ForeignTable = _ForeignTable;
+ ForeignColumn = _ForeignColumn;
}
};