[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782481#action_12782481 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ I'm sure I am the one who is confused. It appeared to me the java-type attribute was being used as a target object type for the framework. If it was originally intended to be the object type the JDBC driver is expecting, then that's not how it is being used today. Or the fieldtype*.xml files are very much out-of-date. It appeared to me that the java-type attribute was a way of abstracting the database details, in effect saying "regardless of how this value in stored in the database, it will be xxx type when used in the framework." Based on your comment, I now know this is wrong, but like I said - that is how it is being used in the current code. My inaccurate evaluation of the java-type's use actually makes more sense than the original intent. For example, what Java object type should you expect to get when you call GenericValue.get()? I always assumed it was the type specified in the java-type attribute. Using that attribute the way it was originally intended, I won't know what Java object type I will get - because each JDBC driver might return something different. So, based on my misunderstanding of what that attribute was used for, this is how I pictured the changes proposed here working: Database -> JDBC driver -> sql-object-type (converted to) -> java-type -> framework code Last night I came up with a better name for the new attribute to help make things clearer: Database -> JDBC driver -> jdbc-type (converted to) -> java-type -> framework code In the majority of field types there is no conversion necessary. For example, all JDBC drivers are going to use the java.lang.String java object type for CHAR and VARCHAR, java.sql.Timestamp for TIMESTAMP, etc. But there are differences in how drivers handle some of the other SQL data types. It would be nice if client code didn't need to know about those differences. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782481#action_12782481 ] Adrian Crum edited comment on OFBIZ-3245 at 11/25/09 4:25 PM: -------------------------------------------------------------- I'm sure I am the one who is confused. It appeared to me the java-type attribute was being used as a target object type for the framework. If it was originally intended to be the object type the JDBC driver is expecting, then that's not how it is being used today. Or the fieldtype*.xml files are very much out-of-date. It appeared to me that the java-type attribute was a way of abstracting the database details, in effect saying "regardless of how this value in stored in the database, it will be xxx type when used in the framework." Based on your comment, I now know this is wrong, but like I said - that is how it is being used in the current code. My inaccurate evaluation of the java-type's use actually makes more sense than the original intent. For example, what Java object type should you expect to get when you call GenericValue.get()? I always assumed it was the type specified in the java-type attribute. Using that attribute the way it was originally intended, I won't know what Java object type I will get - because each JDBC driver might return something different. So, based on my misunderstanding of what that attribute was used for, this is how I pictured the changes proposed here working: Database -> JDBC driver -> sql-object-type -> (converted to) java-type -> framework code Last night I came up with a better name for the new attribute to help make things clearer: Database -> JDBC driver -> jdbc-type -> (converted to) java-type -> framework code In the majority of field types there is no conversion necessary. For example, all JDBC drivers are going to use the java.lang.String java object type for CHAR and VARCHAR, java.sql.Timestamp for TIMESTAMP, etc. But there are differences in how drivers handle some of the other SQL data types. It would be nice if client code didn't need to know about those differences. was (Author: [hidden email]): I'm sure I am the one who is confused. It appeared to me the java-type attribute was being used as a target object type for the framework. If it was originally intended to be the object type the JDBC driver is expecting, then that's not how it is being used today. Or the fieldtype*.xml files are very much out-of-date. It appeared to me that the java-type attribute was a way of abstracting the database details, in effect saying "regardless of how this value in stored in the database, it will be xxx type when used in the framework." Based on your comment, I now know this is wrong, but like I said - that is how it is being used in the current code. My inaccurate evaluation of the java-type's use actually makes more sense than the original intent. For example, what Java object type should you expect to get when you call GenericValue.get()? I always assumed it was the type specified in the java-type attribute. Using that attribute the way it was originally intended, I won't know what Java object type I will get - because each JDBC driver might return something different. So, based on my misunderstanding of what that attribute was used for, this is how I pictured the changes proposed here working: Database -> JDBC driver -> sql-object-type (converted to) -> java-type -> framework code Last night I came up with a better name for the new attribute to help make things clearer: Database -> JDBC driver -> jdbc-type (converted to) -> java-type -> framework code In the majority of field types there is no conversion necessary. For example, all JDBC drivers are going to use the java.lang.String java object type for CHAR and VARCHAR, java.sql.Timestamp for TIMESTAMP, etc. But there are differences in how drivers handle some of the other SQL data types. It would be nice if client code didn't need to know about those differences. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782544#action_12782544 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ A good example of how the java-type attribute is not being used as intended: all fieldtypes*.xml files have the "numeric" field type set to a Java type of "Long." According to documentation I found online and elsewhere: {{Database SQL type JDBC driver Java type -------- ------------------ --------------------- Advantage Integer java.lang.Integer Derby NUMERIC(20,0) java.math.BigDecimal MS SQL INT int MySql DECIMAL(20,0) java.math.BigDecimal Oracle NUMBER(20,0) java.math.BigDecimal}} > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782545#action_12782545 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ Bah. Jira's Wiki markup doesn't work. C&P the table into a monospaced font. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-3245: ------------------------------- Attachment: conversion.patch Updated patch. The new field-type attribute is called jdbc-data-type. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782951#action_12782951 ] David E. Jones commented on OFBIZ-3245: --------------------------------------- It sounds like you're still misunderstanding Adrian. Remember that you are adding the idea of supporting multiple object types externally, and that didn't exist before. The Entity Engine previously dealt with only one object type for each field type, and that object type was the same for the external API as it was for the JDBC driver. This was done by using the JDBC API to set a specific type of object when writing, and also using the JDBC API to get a specific type of object when reading. There is nothing that just does a get and lets the JDBC driver choose what sort of object to return. So, in other words there was only a need for one object type. With what you have going now, I still think there is only a need for one java object type. Having multiple attributes for this would be confusing, or at least it is to me... I still don't see an answer to the question of what you would do with the current java-type attribute if you introduced a new one, no matter what it was named. So, what would it be used for? If it's not used for anything else in your scheme, then let's use it for what it has always been used for and that is to specify the main java object type that will be used to represent a field, and in the case of supporting conversions it would be the one that we trying to convert to before setting in the JDBC API, and for getting the one we would use to get a specific object type from the JDBC API before possibly converting it to the object type requested by the calling code (if you plan to support that, possibly using existing GenericEntity.get* methods). In short, if we're changing the semantics, why does it matter what sort of interpretation you had before for the java-type attribute? Why not just use it instead of introducing something else that makes it tough to figure out what these things mean... since it sounds like there wouldn't be any sort of meaning for the java-type attribute any more. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
PLEASE LET ME KNOW HOW I CAN REMOVE MISELF FROM EMAIL LIST. I DON'T WANT TO RECEIVE ALL THESE EMAILS BUT I DO NOT SEE ANY UNSUBSCRBE LINK. ELI > Date: Thu, 26 Nov 2009 17:46:40 +0000 > From: [hidden email] > To: [hidden email] > Subject: [jira] Commented: (OFBIZ-3245) Sandbox: Integrating The New Conversion Framework Into The Entity Engine > > > [ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782951#action_12782951 ] > > David E. Jones commented on OFBIZ-3245: > --------------------------------------- > > It sounds like you're still misunderstanding Adrian. Remember that you are adding the idea of supporting multiple object types externally, and that didn't exist before. The Entity Engine previously dealt with only one object type for each field type, and that object type was the same for the external API as it was for the JDBC driver. > > This was done by using the JDBC API to set a specific type of object when writing, and also using the JDBC API to get a specific type of object when reading. There is nothing that just does a get and lets the JDBC driver choose what sort of object to return. > > So, in other words there was only a need for one object type. > > With what you have going now, I still think there is only a need for one java object type. Having multiple attributes for this would be confusing, or at least it is to me... > > I still don't see an answer to the question of what you would do with the current java-type attribute if you introduced a new one, no matter what it was named. So, what would it be used for? > > If it's not used for anything else in your scheme, then let's use it for what it has always been used for and that is to specify the main java object type that will be used to represent a field, and in the case of supporting conversions it would be the one that we trying to convert to before setting in the JDBC API, and for getting the one we would use to get a specific object type from the JDBC API before possibly converting it to the object type requested by the calling code (if you plan to support that, possibly using existing GenericEntity.get* methods). > > In short, if we're changing the semantics, why does it matter what sort of interpretation you had before for the java-type attribute? Why not just use it instead of introducing something else that makes it tough to figure out what these things mean... since it sounds like there wouldn't be any sort of meaning for the java-type attribute any more. > > > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > > ------------------------------------------------------------------------ > > > > Key: OFBIZ-3245 > > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > > Project: OFBiz > > Issue Type: Improvement > > Components: framework > > Affects Versions: SVN trunk > > Reporter: Adrian Crum > > Assignee: Adrian Crum > > Priority: Minor > > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > _________________________________________________________________ Bing brings you maps, menus, and reviews organized in one place. http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1 |
Khosrow Khoramian wrote:
> PLEASE LET ME KNOW HOW I CAN REMOVE MISELF FROM EMAIL LIST. I DON'T WANT TO RECEIVE ALL THESE EMAILS BUT I DO NOT SEE ANY UNSUBSCRBE LINK. Look at the raw headers of your email, there's a List-Unsubscribe link. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783178#action_12783178 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ David, Thank you for continuing to participate in the discussion. I think all of your questions have already been answered in my previous comments. Regardless of what the java-type attribute meant originally, it is not being used that way today - the proposed changes won't change that. The additional attribute is optional - if you don't understand it then just leave it out. I still need this patch tested against other databases. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783206#action_12783206 ] David E. Jones commented on OFBIZ-3245: --------------------------------------- Then let's just use the java-type attribute, and not introduce a new one. For most (all?) databases this means that no changes will be needed to the fieldtype*.xml files. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783215#action_12783215 ] Erwan de FERRIERES commented on OFBIZ-3245: ------------------------------------------- Adrian, The error I had before is now gone. But, when loading data in the postgres database, a lot of those lines are showing up [java] 2009-11-28 08:08:08,335 (main) [ SqlJdbcUtil.java:754:INFO ] Unable to convert, falling back on switch statement [java] 2009-11-28 08:08:08,335 (main) [ SqlJdbcUtil.java:754:INFO ] Unable to convert, falling back on switch statement [java] 2009-11-28 08:08:08,335 (main) [ SqlJdbcUtil.java:754:INFO ] Unable to convert, falling back on switch statement > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783422#action_12783422 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ David, Agreed. I will make that change. Erwan, There should be a warning message before those messages that starts with "*** No converter found," - did you see any of those? > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783427#action_12783427 ] Erwan de FERRIERES commented on OFBIZ-3245: ------------------------------------------- Adrian, here is what I found : [java] 2009-11-29 17:51:46,336 (main) [ModelFieldTypeReader.java:139:WARN ] JDBC data type 'BYTEA' for blob not found in fieldtypepostgres. Fields using this type will be ignored. [java] 2009-11-29 17:51:46,336 (main) [ModelFieldTypeReader.java:139:WARN ] JDBC data type 'TIMESTAMPTZ' for date-time not found in fieldtypepostgres. Fields using this type will be ignored. [java] 2009-11-29 17:51:46,413 (main) [ModelFieldTypeReader.java:139:WARN ] JDBC data type 'FLOAT8' for floating-point not found in fieldtypepostgres. Fields using this type will be ignored. [java] 2009-11-29 17:51:46,414 (main) [ModelFieldTypeReader.java:139:WARN ] JDBC data type 'TEXT' for very-long not found in fieldtypepostgres. Fields using this type will be ignored. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783430#action_12783430 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ Erwan - thank you, that really helps! > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-3245: ------------------------------- Attachment: conversion.patch Updated patch. This patch should fix the errors reported by Erwan and also an error reported by Jacopo when using Oracle. I still need to use the new fieldtypes*.xml attribute. I improved the code to do a better job of guessing the JDBC data type of each field, but there are still cases where it must be specified. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790630#action_12790630 ] Nathan Liang commented on OFBIZ-3245: ------------------------------------- Hi, Here is our workaround for the converter error when using oracle, there are some hacks to get around that oracle driver returning non-standard object for JDBC type TIMESTAMP and DATE etc. {noformat} Index: framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java =================================================================== --- framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java (revision 774) +++ framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java (working copy) @@ -501,7 +501,7 @@ Object sourceObject = null; try { - sourceObject = rs.getObject(ind); + sourceObject = getResultSetValue(rs, ind); if (sourceObject == null) { entity.dangerousSetNoCheckButFast(curField, null); return; @@ -960,4 +960,30 @@ addValueSingle(buffer, field, value, params); } } + + public static Object getResultSetValue(ResultSet rs, int index) throws SQLException { + Object obj = rs.getObject(index); + String className = null; + if (obj != null) { + className = obj.getClass().getName(); + } + if (className != null && + ("oracle.sql.TIMESTAMP".equals(className) || + "oracle.sql.TIMESTAMPTZ".equals(className))) { + obj = rs.getTimestamp(index); + } else if (className != null && className.startsWith("oracle.sql.DATE")) { + String metaDataClassName = rs.getMetaData().getColumnClassName(index); + if ("java.sql.Timestamp".equals(metaDataClassName) || + "oracle.sql.TIMESTAMP".equals(metaDataClassName)) { + obj = rs.getTimestamp(index); + } else { + obj = rs.getDate(index); + } + } else if (obj != null && obj instanceof java.sql.Date) { + if ("java.sql.Timestamp".equals(rs.getMetaData().getColumnClassName(index))) { + obj = rs.getTimestamp(index); + } + } + return obj; + } } {noformat} thanks, Nathan > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12790794#action_12790794 ] Adrian Crum commented on OFBIZ-3245: ------------------------------------ Nathan, I am confused. Are you saying the attached patch doesn't fix the problem? > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791175#action_12791175 ] Nathan Liang commented on OFBIZ-3245: ------------------------------------- Hi Adrian, After applying the patch, we got these errors when doing ant run-install: 2009-12-16 11:28:45,937 (main) [ModelFieldTypeReader.java:148:WARN ] jdbc-data-type '.BIGDECIMAL' for currency-amount not found in fieldtypeoracle. Fields using this type will be ignored. 2009-12-16 11:28:45,937 (main) [ModelFieldTypeReader.java:148:WARN ] jdbc-data-type '.BIGDECIMAL' for currency-precise not found in fieldtypeoracle. Fields using this type will be ignored. 2009-12-16 11:28:45,937 (main) [ModelFieldTypeReader.java:148:WARN ] jdbc-data-type '.BIGDECIMAL' for fixed-point not found in fieldtypeoracle. Fields using this type will be ignored. 2009-12-16 11:28:45,953 (OFBiz_Shutdown_Hook) [ ContainerLoader.java:113:INFO ] Shutting down containers Maybe we need more efforts on changing fieldtypeoracle.xml as well as other fieldtype*.xml to get oracle and other databases running. before these improvement get merged into trunk, we would like some temporary solution. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-3245: ------------------------------- Attachment: conversion.patch Nathan, Thank you for trying out the patch. The error you encountered was due to a bug in the patch. Please try the updated patch. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-3245: ------------------------------- Attachment: conversion.patch Updated patch to latest trunk rev. If any one is available to test the latest patch I would really appreciate it! It needs to be tested using Postgres and Oracle databases. > Sandbox: Integrating The New Conversion Framework Into The Entity Engine > ------------------------------------------------------------------------ > > Key: OFBIZ-3245 > URL: https://issues.apache.org/jira/browse/OFBIZ-3245 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: SVN trunk > Reporter: Adrian Crum > Assignee: Adrian Crum > Priority: Minor > Attachments: conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch, conversion.patch > > > This issue contains a patch intended for evaluation before it is committed. See comments for details. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |