avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Froehlich" <g-froehl...@gmx.de>
Subject RE: cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl AbstractColumn.java VarCharColumn.java DefaultColumn.java
Date Wed, 14 Nov 2001 18:27:23 GMT
Hi Kasper,
that's something from the begining of the project.
ResultSetMetaData needs this information (JDBC 2.1).

Maybe that's a source remains

Cheers
Gerhard

>-----Original Message-----
>From: Kasper Nielsen [mailto:news@kav.dk]
>Sent: Wednesday, November 14, 2001 6:21 PM
>To: Avalon Developers List
>Subject: Re: cvs commit:
>jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/im
>pl AbstractColumn.java VarCharColumn.java DefaultColumn.java
>
>
>whats the difference between
>>       public boolean isReadOnly() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>and
>
>>       public boolean isWritable() {
>>           //ToDo: implementation
>>           return false;
>>        }
>
>
>
>
>we might wanna call this isIndexed
>>       public boolean isSearchable() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>
>
>- Kasper
>
>----- Original Message ----- >
>>   1.1
>jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/A
>bstractColumn.java
>>
>>   Index: AbstractColumn.java
>>   ===================================================================
>>
>>   /*
>>    * Copyright (C) The Apache Software Foundation. All rights reserved.
>>    *
>>    * This software is published under the terms of the Apache Software
>License
>>    * version 1.1, a copy of which has been included with this distribution
>in
>>    * the LICENSE file.
>>    */
>>   package org.apache.avalon.db.data.impl;
>>
>>
>>
>>   import org.apache.avalon.db.data.Table;
>>   import org.apache.avalon.db.data.Queryable;
>>   import org.apache.avalon.db.data.Column;
>>
>>
>>   /**
>>    * Class AbstractColumn
>>    *
>>    *
>>    * @author Paul Hammant <a
>href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
>>    * @author Gerhard Froehlich <a
>href="mailto:g-froehlich@gmx.de">g-froehlich@gmx.de</a>*
>>    * @version $Revision: 1.1 $
>>    */
>>   public abstract class AbstractColumn implements Column {
>>
>>       protected String mName;
>>       protected String mSqlType;
>>       protected String mJavaType;
>>
>>       /**
>>        * Constructor AbstractColumn
>>        *
>>        *
>>        * @param name
>>        * @param sqlType
>>        * @param javaType
>>        *
>>        */
>>       public AbstractColumn(String name, String sqlType, String javaType)
>{
>>
>>           mName = name;
>>           mSqlType = sqlType;
>>           mJavaType = javaType;
>>       }
>>
>>       /**
>>        * Method getSQLType
>>        *
>>        *
>>        * @return
>>        *
>>        */
>>       public String getSQLType() {
>>           return mSqlType;
>>       }
>>
>>       /**
>>        * Method getName
>>        *
>>        *
>>        * @return
>>        *
>>        */
>>       public String getName() {
>>           return mName;
>>       }
>>
>>       /**
>>        * Method getJavaType
>>        *
>>        *
>>        * @return
>>        *
>>        */
>>       public String getJavaType() {
>>           return mJavaType;
>>       }
>>
>>       /** methods for the metadata */
>>       public int getColumnDisplaySize() {
>>           //ToDo: implementation
>>           return 0;
>>       }
>>
>>       public String getColumnLabel() {
>>           return mName;
>>       }
>>
>>       public String getColumnName() {
>>           return mName;
>>       }
>>
>>       public int getColumnType() {
>>           //ToDo: implementation
>>           return 0;
>>       }
>>
>>       public String getColumnTypeName() {
>>           return mSqlType;
>>       }
>>
>>       public int getPrecision() {
>>           //ToDo: implementation
>>           return 0;
>>       }
>>
>>       public int getScale() {
>>           //ToDo: implementation
>>           return 0;
>>       }
>>
>>       public String getSchemaName() {
>>           //ToDo: implementation
>>           return null;
>>       }
>>
>>       public String getCatalogName() {
>>           //ToDo: implementation
>>           return null;
>>       }
>>
>>       public String getColumnClassName() {
>>           //ToDo: implementation
>>           return null;
>>       }
>>
>>       public String getTableName() {
>>           //ToDo: implementation
>>           return null;
>>       }
>>
>>       public boolean isAutoIncrement() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public boolean isCaseSensitive() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public boolean isCurrency() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public boolean isDefinitelyWritable() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public int isNullable() {
>>           //ToDo: implementation
>>           return 0;
>>       }
>>
>>       public boolean isReadOnly() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public boolean isSearchable() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public boolean isSigned() {
>>           //ToDo: implementation
>>           return false;
>>       }
>>
>>       public boolean isWritable() {
>>           //ToDo: implementation
>>           return false;
>>        }
>>
>>   }
>>
>>
>>
>>   1.1
>jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/V
>arCharColumn.java
>>
>>   Index: VarCharColumn.java
>>   ===================================================================
>>
>>   /*
>>    * Copyright (C) The Apache Software Foundation. All rights reserved.
>>    *
>>    * This software is published under the terms of the Apache Software
>License
>>    * version 1.1, a copy of which has been included with this distribution
>in
>>    * the LICENSE file.
>>    */
>>   package org.apache.avalon.db.data.impl;
>>
>>
>>
>>   import org.apache.avalon.db.data.Table;
>>   import org.apache.avalon.db.data.Queryable;
>>   import org.apache.avalon.db.data.Column;
>>   import org.apache.avalon.db.data.ValidationException;
>>
>>
>>   /**
>>    * Class VarCharColumn
>>    *
>>    *
>>    * @author Paul Hammant <a
>href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
>>    * @author Gerhard Froehlich <a
>href="mailto:g-froehlich@gmx.de">g-froehlich@gmx.de</a>*
>>    * @version $Revision: 1.1 $
>>    */
>>   public class VarCharColumn extends AbstractColumn {
>>
>>       private int mMaxLength;
>>
>>       /**
>>        * Constructor VarCharColumn
>>        *
>>        *
>>        * @param name
>>        * @param maxLength
>>        * @param javaType
>>        *
>>        */
>>       public VarCharColumn(String name, int maxLength) {
>>           super(name,"varchar",String.class.getName());
>>           mMaxLength = maxLength;
>>       }
>>
>>       public void test(Object obj) throws ValidationException {
>>           String str = (String) obj;
>>           if (str.length() > mMaxLength) {
>>               throw new ValidationException("String " + mName + "at is too
>long at " + str.length());
>>           }
>>       }
>>
>>
>>
>>   }
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
><mailto:avalon-dev-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
><mailto:avalon-dev-help@jakarta.apache.org>
>>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message