Bug 36 : @Transient types not mapped to a known ScalarType throw error...
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
0.9.6
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
21/02/2008
Updated 
21/02/2008
Type 
Bug
 
Attachments 
No attachments

Introduced this in 0.9.5...

aused by: javax.persistence.PersistenceException: No ScalarType for [java.io.Serializable]
at com.avaje.ebean.server.deploy.parse.DeployUtil.setScalarType(DeployUtil.java:315)
at com.avaje.ebean.server.deploy.parse.TransientProperties.process(TransientProperties.java:51)
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.createDeployInfo(BeanDescriptorFactory.java:234)
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.createBeanDescriptor(BeanDescriptorFactory.java:131)
at com.avaje.ebean.server.deploy.BeanDescriptorCacheFactory.createBeanDescriptor(BeanDescriptorCacheFactory.java:164)
at com.avaje.ebean.server.deploy.BeanDescriptorCacheFactory.deployBeanDescriptors(BeanDescriptorCacheFactory.java:217)
at com.avaje.ebean.server.deploy.BeanDescriptorCacheFactory.initialiseAll(BeanDescriptorCacheFactory.java:122)
at com.avaje.ebean.server.deploy.DeploymentManager. init (DeploymentManager.java:89)
at com.avaje.ebean.server.plugin.PluginCore. init (PluginCore.java:46)

 
Rob 21 Feb 05:40
The reasoning...

Now, I think this came in because I want to be able to use Transient types SOMETIMES as non-transient.

Specifically when you specify your own SQL via SqlSelect you could put a count() avg() sum() etc value into a property that is otherwise @Transient. So that was a good thought (I think) but I have introduced this bug... If the transient isn't a Ebean known scalar type then this stack trace occurs.

The fix is to... try to determine the DB types for @Transients... but if I can't find one, then to continue and not throw this lovely stackTrace :) Thats cool, except that you will not be able to use @Transients not mapped to a known type in a SqlSelect.

Rob 21 Feb 05:45
Fixed in 0.9.5b

Fixed, basically put a try catch when setting the scalar type for @transients... if it fails thats ok. Just means we can not use that property in a SqlSelect.

woResponse

Upload a file