db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: Does JPOX support PK fields of type java.sql.Date?
Date Wed, 10 Aug 2005 18:04:40 GMT
Hi Michael,

> for testing reasons I changed the type of a PK field from java.util.Date
> to java.sql.Date. Running the JPOX enhancer I noticed that the declaring
> pc class was not enhanced. After I changed the field type back to
> java.util.Date, the pc class was enhanced properly. Does JPOX support
> java.sql.Date for PK fields?

Don't see why not, but then I don't see somewhere where I'd want to ;-)

> You can easily reproduce the problem patching class
> "org.apache.jdo.tck.pc.singlefieldidentity.PCPointSingleFieldDate": Just
> change the import statement "import java.util.Date;" to "import
> java.sql.Date;" and run the JPOX enhancer for application identity:

Well if you do that you need to bear in mind that java.sql.Date is *not* by 
default persistent (nor is it in the DFG), whereas java.util.Date is. In your 
class you have no persistence-modifier="persistent" and so the field that you 
want to be PK is *not* actually persistent. That's likely the issue. If you 
look in the log from the enhancer you'll probably find something


View raw message