-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported type #10
Comments
Yes Calendar is not managed. Use classic Date instead. Calendar is a tool to manage time, not really a time container and also one the most catastrophic API in Java :D. I still wonder how we obtained this from a standardization process ;) scala.BigDecimal is not managed as Siena is only Java for the time being (even if you can use it from Scala). But java.BigDecimal is managed and there is a doc in Siena github wiki about it. |
;-) anyways, is there a way i could still use these types in my scala code and specify another overriding (SQL/ Java ? ) data type (like a @column annotation) ? If possible, I wouldn't want to use Java in my code just because of Siena. |
It's not trivial since this case hasn't been foreseen in Siena until now:) Then if you don't want to use any Java types in your Scala code, you should think of an implicit conversion. Pascal |
tried, it doesn't like implicit conversions either for some reason :-( |
Your implicit conversion must be completely external to the siena model. IMO, you must write a Java-style class for Siena and a mirrored pure-Scala class and a conversion from the Java-style class to the pure-Scala class. |
ah! hmm, sure i'll change my code to java data types for now, thanks for the tip! |
Sorry for that ;) |
no problem! scala is cool indeed :-) |
I am using Siena with Scala and it complains of java.util.Calendar and scala.BigDecimal as unsupported types.
play.exceptions.UnexpectedException: Unexpected Error
at play.Play.start(Play.java:525)
at play.Play.detectChanges(Play.java:610)
at play.Invoker$Invocation.init(Invoker.java:186)
at Invocation.HTTP Request(Play!)
Caused by: siena.SienaRestrictedApiException: Siena[db=h2][api=createColumn] Restricted Usage - Message:Unsupported type
for field models.Metric.vendorFunds
at siena.jdbc.ddl.DdlGenerator.createColumn(DdlGenerator.java:257)
at siena.jdbc.ddl.DdlGenerator.addTable(DdlGenerator.java:77)
at play.modules.siena.SienaPlugin.onApplicationStart(SienaPlugin.java:148)
at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:425)
at play.Play.start(Play.java:495)
The text was updated successfully, but these errors were encountered: