db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <ar...@code-au-lait.de>
Subject Kernel api changes be necessary!?
Date Tue, 11 Nov 2003 01:04:38 GMT
Hi all,

ok, sounds a little bit inflammatory but I
want response as quickly as possible ;-)

In SqlTypeHelper a method
public static int getSqlTypeByValue(Object value)

exists. This method returns the jdbc type of the
given object. The value is in all cases a persistence
capable field value.

But this information is declared in the metadata.
With FieldDescriptor#getColumnJdbcType() we can request
this information. So we don't need this method.

Another problem is the support of BOOLEAN datatype.
If the given object in getSqlTypeByValue(Object value)
is instance of Boolean always Types.BIT is returned. So
there is no way to support Type.BOOLEAN.

Thus I assume we have a 'design bug' in kernel api.

Usage of this method:
SqlTypeHelper#getSqlTypeByValue(Object)
<-- SqlHelper#getSqlTypeByValue(Object)
<-- StatementManager#bindValues(PrepareStmt stmt, Object[] values, int 
index)

To solve the problem we should pass a FieldDescriptor- or a
jdbcType-array, containing all associated FieldDescriptors/jdbcTypes
of the object array.

Method StatementManager#bindValues(...) was only used by
JdbcAccess in
JdbcAccess#executeUpdateSQL(String sql, ClassDescriptor cld, Object[] 
obj, boolean scrollable)
JdbcAccess#executeSQL(...)

I think we need to change method signature in these methods.

StatementManager#bindValues
(PrepareStmt stmt, Object[] values, int index)
change to ==>
StatementManager#bindValues
(PrepareStmt stmt, Object[] values, int[] jdbcTypes, int index)

JdbcAccess#executeUpdateSQL
(String sql, ClassDescriptor cld, Object[] obj, boolean scrollable)
change to ==>
JdbcAccess#executeUpdateSQL
(String sql, ClassDescriptor cld, FieldDescriptor[] fields, Object[] 
obj, boolean scrollable)

Same for JdbcAccess#executeSQL(...)

Any comments?

regards,
Armin





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message