For those interested I have an ‘example maven project for using Ebean ORM with Kotlin’ here:
Any feedback is welcome, I’ve only being using Kotlin for a few hours so I’m the proverbial Kotlin newbie and ‘tough love’ comments are welcome. I’ll look to maintain this example project going forward attempting to show ‘best practice’ and add examples that showcase Kotlin language features in the context of using Ebean ORM.
I found converting the java code over to Kotlin very easy and it all worked apart from one thing which I’ll look into (Transaction runnable using a anonymous java inner class - I converted from java manually so I probably stuffed something up here). I was most interested to initially test that the bytecode enhancement of the JPA annotated entity beans worked and that was all fine although I have yet to test non-default constructors and some other edge cases.
To the people working hard on Kotlin - Keep up the great work !! I think it is very impressive and very ‘sellable’ especially to teams with large existing java code bases and tools.
I’m the main contrbutor to Ebean ORM so I can make it ‘Kotlin friendly’ as necessary (perhaps add @NotNull @Nullable annotations)
Ebean ORM uses JPA annotations for mapping but it is not a JPA implementation. I’d describe Ebean as - Sessionless / No EntityManager / Query language supports ‘partial objects’