JPA and Mysql query on play framework - jpa

I am new and i need help about using JPA on play framework.
Anyone can give me a sample about convert mysql query to JPA? or good Tutorials?
Better with example or sample code. thanks a lot.

Play!Framework has very good documentation on this topic, go and check http://www.playframework.org/documentation/1.2.4/jpa#finding.
You can also find many useful code from the samples packaged in the installation package

Related

Is there any caching mechanism in Slick?

I'm new in Slick and Play and I can't find any references about caching in docs(2 and 3rc). Is there any native way in Slick for cache organization or if not tell me, please, why and whats the reasons for not having it? Summary, I hope that somebody help me in this question or show another better way.
I don't think Slick has got anything, it is just for interacting with a RDBMS. But since you are using play framework you have the play cache API:s that you can use, for example in a DAO that wraps Slick. You can read more about it in the play framework docs here: https://www.playframework.com/documentation/2.3.x/ScalaCache
Also see http://slick.typesafe.com/doc/2.1.0/orm-to-slick.html#read-caching and the following section

Play framework 2 scala with MongoDB

I am new in play framework 2.
I have play 2 with scala and MongoDb requirement.
I searched lots on Play 2 and MongoDb connection, but didn't find any useful documentation.
There is lots of plugins available eg. Casbah, Reactive Mongo, Salat. So which is best for use, and which have better future?
If i want to implement my own connection to Mongo without using third party plugin, is it possible?
Please give examples and document on Play 2 and MongoDB connection.
I suggest using ReactiveMongo as its non-blocking approach is similar to how Play itself works. The API works with scala Futures which is a a really nice fit with Play's Async actions. You can also use their macros to convert case classes straight to BSON sparing quite some boilerplate code.
A lot of time has passed but I would like to share an update for those, who may search for Scala MongoDB client library for Play Framework.
Reactive Mongo is great but still lacks Play Framework 2.4 integration and MongoDB 3.0. We have waited for a long time thus wrote a library that wraps original MongodDB client in the Scala style way and is similar to Reactive Mongo in the api. Take a look at https://github.com/evojam/play-mongodb-driver. With the Play Framework module it's pretty straightforward to start, like few minutes to get working code.
This way MongoDB is nice and easy to use in Scala. We have provided a comparison of the sample query execution is in our blog post about the driver on site.

CRUD operations on a database in Play

I'd like to be able to create/delete/change a database and tables, create/delete indexes and all these kinds of things by Scala code, not by an sql file. Probably, using anorm. Is wonder, is it possible?
I know it's possible to do CRUD operations with tables.
Slick is a Scala ORM that can do most of what you're asking for, however it does not have a pure Scala way of creating a new database. You can read more about that here.
You say you are using play then start off using Ebean ORM
Have a look at
Play Persistance
and
Avaje EBean
If you have downloaded play look in the samples directory there is a computer database example. It is a very good example of CRUD
Good luck
I would recommend slick! Slick at first seems different if you are moving from directly stating your statements, but it is super handy to work with. Check it out here

Is Morphia based on Java driver for MongoDb and can it work if domain model is scala?

Is it based on mongoDb java driver ?
Can I use it when the domain model is scala program in version 1.2.2RC1+ of play framework?
Please note that questions that may have been answered before may not be relevant to play framework version 1.2.2RC1+.
If you are looking for a high level Java client for MongoDB, Give Kundera (https://github.com/impetus-opensource/Kundera) a try. It’s a JPA based client library for Cassandra, Hbase and MongoDB. There is a pretty good example here: https://github.com/impetus-opensource/Kundera/wiki/Getting-started
Morphia does run on top of/uses the mongodb java driver. All java ORM solutions do. I don't see why it would be a problem to run it in Scala. I have no experience with the "play framework".

Is it possible to integrate Doctrine 2 with Zend Framework 1.1x?

I'd really like to use and test Doctrine 2 and Zend Framework, but I don't where to start, and I don't know if both are compatible?
Do you have any feedback?
How could I integrate Doctrine 2 with Zend Framework 1.1x?
Thanks in advance.
After a long day of search, I found two implementations which of one I liked much because of its documentation and simplicity.
It is part of a Zend Framework extension called Bgy library, there is an Application Resource to help bootstraping both Web application and CLI.
There are several resources which will help you get started:
Bisna library
Cob library
2-part series on integration
A Doctrine 2 blog post I wrote myself on fundamentals
Have a look at the excellent ZendCast: http://www.zendcasts.com/unit-testing-doctrine-2-entities/2011/02/