Issue Details (XML | Word | Printable)

Key: OPENJPA-266
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Catalina Wei
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

Add Extensibility: Change "private" field/method to "protected" or "public" in OpenJPA classes to be extendable

Created: 26/Jun/07 12:04 AM   Updated: 07/Aug/07 10:23 PM
Return to search
Component/s: jdbc
Affects Version/s: 1.0.0
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works DBDictionaryFactory.patch 2007-07-31 05:11 PM Catalina Wei 6 kB
Text File Licensed for inclusion in ASF works OpenJPA-266.patch 2007-07-23 10:01 PM Catalina Wei 4 kB
Text File Licensed for inclusion in ASF works OPENJPA-266.patch.txt 2007-06-29 02:31 PM Michael Dick 5 kB

Resolution Date: 07/Aug/07 10:23 PM


 Description  « Hide
In order to extend existing OpenJPA classes, for example OperationOrderUpdateManager, private field or method needed to change to protected or public.
This kind of modification is not adding any functionality but making OpenJPA classes subclassable.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Catalina Wei added a comment - 26/Jun/07 08:14 PM
The changes in the attached patch enable extensibility only.

Catalina

Catalina Wei made changes - 26/Jun/07 08:14 PM
Field Original Value New Value
Attachment openjpa-jdbc.patch [ 12360614 ]
Catalina Wei added a comment - 26/Jun/07 08:18 PM
This patch has passed TCK with Derby

Catalina

Kevin Sutter made changes - 26/Jun/07 09:04 PM
Attachment openjpa-jdbc.patch [ 12360614 ]
Kevin Sutter added a comment - 26/Jun/07 09:06 PM
Although Catalina's patch passed the TCK, there were a couple of "extra contributions" that probably shouldn't have been part of the patch. Catalina will re-work the patch and re-post shortly. Thanks for your patience!

Catalina Wei added a comment - 26/Jun/07 10:08 PM
changes are mostly in "private" to "protected".

Catalina Wei made changes - 26/Jun/07 10:08 PM
Attachment openjpa-jdbc.patch [ 12360622 ]
Repository Revision Date User Message
ASF #550977 Tue Jun 26 22:43:25 UTC 2007 mikedd OPENJPA-266 Allowing PreparedStatementManagerImpl to be extendable
Files Changed
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java

Michael Dick made changes - 29/Jun/07 02:30 PM
Attachment openjpa-jdbc.patch [ 12360622 ]
Michael Dick added a comment - 29/Jun/07 02:31 PM
Attaching updated patch. I committed the changes to PreparedStatementImpl earlier this week. This patch contains the rest of the changes Catalina proposed.

Michael Dick made changes - 29/Jun/07 02:31 PM
Attachment OPENJPA-266.patch.txt [ 12360817 ]
Repository Revision Date User Message
ASF #552039 Fri Jun 29 21:22:01 UTC 2007 wisneskid OPENJPA-266, committing the patch.
Files Changed
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/PreparedStatementManagerImpl.java
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/AbstractUpdateManager.java

Repository Revision Date User Message
ASF #554803 Tue Jul 10 02:28:11 UTC 2007 wisneskid OPENJPA-266, extensibility for platform specific version column
Passed TCK with Derby
Files Changed
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/RowImpl.java
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java

Catalina Wei added a comment - 23/Jul/07 10:01 PM
Allow vendor "extended" DB Dictionaray plugins.
For example,
public Class MyDB2Dictionary
    extends org.apache.openjpa.jdbc.sql.DB2Dictionary { ...}

By changing default plugin values by :
JDBCConfigurationImpl.dbdictionaryPlugin.setAlias("db2", "test.MyDB2Dictionary")

will instantiate test.MyDB2Dictionary

Catalina Wei made changes - 23/Jul/07 10:01 PM
Attachment OpenJPA-266.patch [ 12362380 ]
Repository Revision Date User Message
ASF #558881 Mon Jul 23 22:19:28 UTC 2007 wisneskid OPENJPA-266 process dbdictionaryPlugin values for vendor specific DB Dictionary.
Files Changed
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java

Michael Dick added a comment - 24/Jul/07 02:49 PM
The last change regarding DBDictionaries looks like it's a good start, but I have a few questions / issues.

The changes seem to be intended to enable other vendors to repackage OpenJPA with their own set of DBDictionaries. This is a good thing, but the code only allows DB2, Oracle and SQLServer to be extended. This should be expanded and generalized to allow any DBDictionary to be overridden.

The fix also requires the user to get a configuration object and cast it to our implementation class. This should be changed to use the JDBCConfiguration interface.

If this is intended for use by other vendors, why don't we just provide the ability for the DBDictionaryFactory class to be extended? If the DBDictionaryFactory class was configurable (like SQLFactory for example), then vendors could prefer their own set of classes without messing around with JDBCConfigurationImpl.


Patrick Linskey added a comment - 24/Jul/07 04:30 PM
Agreed. Additionally, it is already trivial for vendors to repackage OpenJPA with different dbdictionaries. All you need to do is create a ProductDerivation that changes the aliases listed in the JDBCConfigurationImpl.dbdictionaryPlugin.

See JDBCPersistenceProductDerivation for an example of a product derivation that changes alias settings.

Catalina Wei added a comment - 31/Jul/07 05:11 PM
use dbdictionaryPlugin value to load vendor specific DBDictionary.

Catalina Wei made changes - 31/Jul/07 05:11 PM
Attachment DBDictionaryFactory.patch [ 12362898 ]
Repository Revision Date User Message
ASF #561413 Tue Jul 31 18:01:19 UTC 2007 wisneskid OPENJPA-266 load platform specific DBDictionary from dbdictionaryPlugin
Help committing Catalina's DBDictionaryFactory.patch
Files Changed
MODIFY /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactory.java

Patrick Linskey made changes - 07/Aug/07 06:42 PM
Fix Version/s 1.0.0 [ 12312341 ]
David Wisneski made changes - 07/Aug/07 10:23 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.0.0 [ 12312341 ]
Resolution Fixed [ 1 ]