deanhiller / playorm

ORM for nosql with SCALABLE SQL
https://github.com/deanhiller/playorm/wiki
Other
76 stars 18 forks source link

Playframework 2.1 plugin needs scala version #96

Open hsn10 opened 11 years ago

hsn10 commented 11 years ago

Playframework plugin needs to have both scala and java version. Artifact for scala will have scala number appended - standard in scala community, so they can be both uploaded to maven repo.

currently playframework plugin depends on "javaCore". If you have scala playframework app and want playorm you need to add javaCore to work. While adding one more dependency is not a problem. There seems to be runtime check in template generator if javaCore is included because it generates templates with different API.

java uses play.data.* while scala play.data.api.*; they might be other differences in generated templates as well.

Plugin seems to be very small, so adding few scala lines to make scala version would not be problem. Alternative solution is to make playframework work without need to add javaCore.

hsn10 commented 11 years ago

where is plugin source code? i see just binary JAR in https://github.com/deanhiller/playorm/tree/master/src/resources/play2plugin

easility commented 11 years ago

The code is checked in at https://github.com/easility/Play2Plugin now.

hsn10 commented 11 years ago

code for this was merged to https://github.com/easility/Play2Plugin

easility commented 11 years ago

Is it completely done now? Are you able to test with both Scala and Java?

hsn10 commented 11 years ago

Yes, this is done. There is another problem with play plugin - entities are not saved to database, but it didn't worked with original plugin too, so its not regression. This issue - needs to work with both java and scala is done.

easility commented 11 years ago

Old plugin was working fine. An example project is checked in which is using the Plugin.jar and it is still working fine..You may see "https://github.com/easility/play2pluginexample" . If you will run this in Play2.1.0 it will show the messages at console. You may call localhost:9000/save which was using em.flush()

deanhiller commented 11 years ago

yes, my guess is you did not call mgr.flush which takes all the puts you did and writes them to noSQL in parallel where as if we put them in noSQL at mgr.put call, then they would be come serialized writes and slow down your system....writing in parallel is more optimal.

hsn10 commented 11 years ago

pull request for scala version sent.

hsn10 commented 11 years ago

This is done. Both plugins (java and scala) can be published maven central after playframework 2.2 is released

easility commented 11 years ago

Many thanks. So will it not work with Play 2.1.1? We will publish the play2plugin soon in mavenrepo..till then, we can keep this ticket open.

hsn10 commented 11 years ago

it works with play 2.1.1 but it can not be pushed to central because play framework is not in central repo. Play 2.2 will be pushed to central.

easility commented 11 years ago

Ok. We are trying to push it into maven repo. @deanhiller : Will group id "com.alvazan" and artifactid "play2plugin" be ok for this plugin?

hsn10 commented 11 years ago

in sbt i have set group "com.alvazan.play2" and artifacts "plugin" for scala and "plugin-java" for java version

deanhiller commented 11 years ago

I am not picky. Go with what @hsn10 wants here.

easility commented 11 years ago

Ok. We are onto it..there is some issue that the jar is creating as plugin-root.XX.jar and pluging-java.jar..

hsn10 commented 11 years ago

plugin-root is empty jar if you do sbt publish it will not be published. If you do sbt assembly then you will have available repackaged java plugin to include scala plugin -> you will need to deploy just one jar.