You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Thomas Dudziak <to...@first.gmd.de> on 2003/12/17 23:50:30 UTC
Things noted in JdbcTypesHelper (unrelated to: OJB does not respect
the jdbc-type declared in the repository)
As I changed the jdbc type mapping used in the XDoclet module so that is
in accordance with the OJB type mapping, I noticed two things in the
JdbcTypesHelper class:
* It uses a hashmap to map from java.sql.Types to JdbcType, but it uses
long if-else statements for mapping from the jdbc name or java class
name. Wouldn't it be useful to also have maps for these uses ?
* There are no if-else branches for java.sql.Array/Blob/Clob in
getJdbcTypeByReflection. I'm no expert on jdbc, so I can't tell whether
these types might actually be used in an application, though I suspect
they are.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org
Re: Things noted in JdbcTypesHelper (unrelated to: OJB does not respect
the jdbc-type declared in the repository)
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Tom,
Thomas Dudziak wrote:
> As I changed the jdbc type mapping used in the XDoclet module so that is
> in accordance with the OJB type mapping, I noticed two things in the
> JdbcTypesHelper class:
>
> * It uses a hashmap to map from java.sql.Types to JdbcType, but it uses
> long if-else statements for mapping from the jdbc name or java class
> name. Wouldn't it be useful to also have maps for these uses ?
Yes, this would be useful, but this method only be called one time per
field to associate FieldDescriptor with JdbcType (no big performance
issue). Same for getJdbcTypeByReflection. Thus I was too lazy to adapt
the if-else statements ;-).
Checked in changes (trunk + 1.0 branch).
>
> * There are no if-else branches for java.sql.Array/Blob/Clob in
> getJdbcTypeByReflection. I'm no expert on jdbc, so I can't tell whether
> these types might actually be used in an application, though I suspect
> they are.
I'm not an expert too ;-)
Feel free to add these mappings if useful.
regards,
Armin
>
> Tom
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org