I would like a lightweight way to have Hibernate automatically convert Ceylon types like ceylon.language.String and ceylon.language.Integer to java.lang.String and java.lang.Long when the Ceylon type is passes to EntityManager.find() and friends, and Query.setParameter(). I was thinking that this could be something as simple as an implicit contract to call a `stringValue()` or `longValue()` method instead of throwing stuff like: {{ java.lang.IllegalArgumentException: Provided id of the wrong type for class jaxrs.example.entity.Employee. Expected: class java.lang.Long, got class ceylon.language.Integer}}. But I'm open to other suggestions. What I don't want to have to do is go annotating everything explicitly with JPA's `@Convert`. And I want it to work when I don't have complete control over Hibernate, for example, when Hibernate is instantiated by Spring or by Java EE. |