I'm using WebSphere 7 and their JPA 2.0 implementation which is based on OpenJPA, and I have something driving me crazy. I have to connect to a SQL Server 2008 database that uses the database column encryption. The encryption is done by several database commands:
1 - OPEN SYMMETRIC KEY DECRYPTION BY CERTIFICATION
2 - Perform insert/select/update/etc using the database methods EncryptByKey or DecryptByKey
3 - CLOSE SYMMETRIC KEY
I have searched and it does not appear that OpenJPA supports this functionality. Does anybody know how to get OpenJPA to play nicely with this type of encryption? Or should I just skip JPA for this project and use good old fashioned PreparedStatements?