[ 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 The attached patch integrates the new conversion code into the entity engine. The patch is a work in progress, so it isn't finished yet - I still need to do some cleanups and finish the JavaDocs. It would really help if other developers could try out the patch with various databases to insure compatibility. I have tested it with Derby and Advantage. I would like for it to be tested with MySql and Postgres. Any help in this area would be greatly appreciated! Just apply the patch and run ant run-install. Check the log for any exceptions. Report any exceptions in this issue. Summary Using the converters with values retrieved from the database was easy - because the ResultSet can be queried for the object type of the field. Getting the converters to work when setting a value is tricky - because there is no easy way to know what object type the JDBC driver is expecting. There is a way to get that information from the PreparedStatement, but that method was introduced in JDBC 3, and not all drivers support JDBC 3. The solution I came up with was to create an entity with every field type in it (EntityDataTypes). When the ModelFieldType objects are created, the EntityDataTypes entity is queried, and the information contained in the returned ResultSet is used to set up the correct object types for that JDBC driver. It looks like a kludge, but it is the only way I could come up with to create accurate conversions for any database. This change might improve throughput - because the get and store operations are more direct - so there is no navigating long switch statements and additional conditional code. Comments and suggestions are welcome! > 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 > > > 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.