User: obo Date: 2006/07/10 07:17:57 Modified: dba/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java
Log: INTEGRATION: CWS qiq (1.2.54); FILE MERGED 2006/06/29 10:16:42 fs 1.2.54.1: support for foreign keys File Changes: Directory: /dba/connectivity/qa/connectivity/tools/ =================================================== File [changed]: HsqlColumnDescriptor.java Url: http://dba.openoffice.org/source/browse/dba/connectivity/qa/connectivity/tools/HsqlColumnDescriptor.java?r1=1.2&r2=1.3 Delta lines: +36 -14 --------------------- --- HsqlColumnDescriptor.java 6 Feb 2006 16:43:01 -0000 1.2 +++ HsqlColumnDescriptor.java 10 Jul 2006 14:17:55 -0000 1.3 @@ -39,32 +39,54 @@ */ 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; } }; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
