openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Float primary key?
Date Wed, 11 Apr 2007 03:36:40 GMT
I know it is a really really really stupid idea to use an approximate  
type at a primary key, but there is a test in the CMP test suite that  
uses a float for a primary key.  When I deploy this bean, I get an  
exception like the following:

Caused by: <0.9.7-incubating-SNAPSHOT fatal user error>  
org.apache.openjpa.persistence.ArgumentException: Type "class  
foo.FloatBeanEJB" declares field "cmpID" as a primary key, but keys  
of type "java.lang.Float" are not supported.
     at org.apache.openjpa.meta.ClassMetaData.validateAppIdClass 
(ClassMetaData.java:1800)
     at org.apache.openjpa.meta.ClassMetaData.validateIdentity 
(ClassMetaData.java:1779)
     at org.apache.openjpa.meta.ClassMetaData.validateMeta 
(ClassMetaData.java:1696)
     at org.apache.openjpa.meta.ClassMetaData.resolve 
(ClassMetaData.java:1569)
     at org.apache.openjpa.meta.MetaDataRepository.processBuffer 
(MetaDataRepository.java:656)
     at org.apache.openjpa.meta.MetaDataRepository.resolveMeta 
(MetaDataRepository.java:556)
     at org.apache.openjpa.meta.MetaDataRepository.resolve 
(MetaDataRepository.java:481)
     at org.apache.openjpa.meta.MetaDataRepository.getMetaData 
(MetaDataRepository.java:285)
     at org.apache.openjpa.meta.MetaDataRepository.resolveMeta 
(MetaDataRepository.java:521)
     at org.apache.openjpa.meta.MetaDataRepository.resolve 
(MetaDataRepository.java:481)
     at org.apache.openjpa.meta.MetaDataRepository.getMetaData 
(MetaDataRepository.java:285)
     at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping 
(MappingRepository.java:276)
     at org.apache.openjpa.jdbc.meta.MappingTool.getMapping 
(MappingTool.java:667)
     at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema 
(MappingTool.java:739)
     at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java: 
637)
     at  
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings 
(JDBCBrokerFactory.java:161)
     at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl 
(JDBCBrokerFactory.java:127)
     at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker 
(AbstractBrokerFactory.java:171)
     at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker 
(DelegatingBrokerFactory.java:139)
     at  
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMana 
ger(EntityManagerFactoryImpl.java:187)
     at  
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMana 
ger(EntityManagerFactoryImpl.java:52)

Is there any way I can turn off this warning?  Maybe we can add an  
"AllowStupidApproximatePrimaryKeys" flag.

Please :)

-dain

Mime
View raw message