This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Play! Framework - Viable replacement for JPA's find() method in Ebeans

 
Samuel Bird
Ranch Hand
Posts: 96
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying to pick up the Play! Framework recently and decided to go through the tutorial they provide for building a blog. I am aware that this is using JPA which is no longer supported by Play! and has been replaced by Ebeans. However, I decided to give it a go anyway and ad-hoc it a bit. Anyway, I got to the part saying that I have got to add a connect method (see the tutorial fro details) and I have to make use of the find() method found in play.jpa.Model. However, no such method exists in play.ebean.Model. I am looking to find an alternative or another approach I could take for this method.

I have done some research and have come across the ebean.find() method. However, I do not see how I can use this for my purpose. I would greatly appreciate it if anyone could give me any advice on how to move forward. Thanks in advance.
 
Samuel Bird
Ranch Hand
Posts: 96
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, I just came across this fetch. This look as though it could be useful. Does anyone know if it could help?

EDIT: It appears to have something to do with Lists. I have a feeling this won't be much use.
 
Samuel Bird
Ranch Hand
Posts: 96
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may be completely wrong but I have changed the original connect method:



to a method that uses fetch and find:



I don't think this works but I would appreciate other opinions on if I am going int he right direction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic