Questions tagged [ebean]

Ebean is an open source Object Relational Mapping tool. It's goal is to provide a simpler alternative to JPA (Java Persistence API) implementations such as Hibernate and Eclipselink.

Ebean is an open source Object Relational Mapping tool.

It's goal is to provide a simpler alternative to JPA (Java Persistence API) implementations such as Hibernate and Eclipselink.

It does this by providing a “sessionless” API and a simpler query language. That means:

  • No Session Object (or UnitOfWork or EntityManager)
  • No Attached or Detached Beans
  • No merge(), persist(), flush(), or clear(). Instead Ebean has save() and delete()

Ebean, just like JPA has a Persistence Context but has some architectural differences to allow it to have a different approach to the entity bean lifecycle and removing the need to manage EntityManagers.

Why Ebean? ... why different from JPA?

Ebean uses the JPA Mapping annotations and will follow those very closely.

However, Ebean has been architected and built from a different perspective than JPA. The Architectural and Query language differences are reasonably fundamental to both Ebean and JPA so its hard to see these differences going away anytime soon.

JPA is architected to use an “EntityManager” which closely matches a Hibernate “Session” and a Toplink “UnitOfWork”. This brings with it the concepts that an entity bean can be attached or detached from the EntityManager (with associated merge, flush clear operations etc). If the EntityManager is used across multiple Transactions the EntityManager needs to be managed typically by a EJB Session Bean, Seam, Spring or similar container/framework.

Ebean is architected to not require an EntityManager (or Session or UnitOfWork object) with the goal of making it easier to use and to remove the requirement to manage EntityManager objects (Aka a different approach to Lifecycle management).

Although Ebean doesn't have a EntityManager it DOES have a “Persistence Context” (like JPA) and by default in Ebean the persistence context is transaction scoped and automatically managed.

1101 questions
-1
votes
1 answer

ebean cache issue with @ManyToMany relation

I got an exception when I try to basically read a @ManyToMany relation using ebean cache system (with io.ebean:ebean-redis). This is a SpringBoot application. The versions I am…
jkohler
  • 1
  • 1
-1
votes
2 answers

Ebean query operator "Fetch" isn't working when I use more than one relationship path

It is my understanding that when I use fetch when querying an object, Ebean will try to fetch the relationship using a join. e.g. Ebean.find(ProjectRequest.class) .fetch("attachments") .findList(); This…
Sam Orozco
  • 1,258
  • 1
  • 13
  • 27
-1
votes
1 answer

Ebean Many To Many RelationShip in Playframework

i would like to create a many to many relationship between two tables "Term" and "Synonym" but i dont now how to write them Models !! Any Help ! and thnx a lot.
-1
votes
1 answer

Is there any JPA annotation for SHA2 as like in mysql

Is there any jpa annotation for mysql SHA2. I need to create a field in ebean which should use SHA2 through annotation. Thanks.
Robin
  • 533
  • 2
  • 5
  • 16
-1
votes
2 answers

How to use @DbEnumValue with Ebean in Kotlin?

Background I'm trying to convert this Ebean example from Java into Kotlin: http://ebean-orm.github.io/docs/mapping/extension/dbenumvalue Here's the sample Java code: public enum Status { NEW("N"), ACTIVE("A"), INACTIVE("I"); String…
GlenPeterson
  • 4,866
  • 5
  • 41
  • 49
-1
votes
1 answer

Java Play - How to query OneToMany Ebean

I have the following models: @Entity @Table(name = "post") public class Post extends Model { @Id @GeneratedValue public Long id; @Column(name = "url", nullable = false, length = 255) public String url; …
Rua Tahi
  • 238
  • 5
  • 15
-1
votes
1 answer

ebean validation in play framework 2.5

I was looking at the sample code provided on their page : @Entity public class Task extends Model { @Id @Constraints.Min(10) public Long id; @Constraints.Required public String name; public boolean done; …
Lee
  • 1
  • 4
-1
votes
1 answer

Play Framework return same values from different lists attributes

I have two list of relations in the class User: @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name="foreign_stories") List foreignStories; @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name="preferred_stories") List
-1
votes
1 answer

ManyToMany Ebean mapping not working from View

Good day All, I have 2 models(Products and ProductCategory) that are related to each other in a ManyToMany relationship. However when i am trying to save a Product form that contains a html select field that is supposed to map to the ProductCategory…
Nnamdi Jibunoh
  • 156
  • 1
  • 8
-1
votes
1 answer

How to map @EmbeddedId in Ebean with Scala

In Custom bridge table in playframework ebean there is an example how to map model using @EmbeddedId with Ebean in Java. But there is no such example for Scala language. Lets assume we have a following 3-class model in Scala: Student class: class…
rtruszk
  • 3,902
  • 13
  • 36
  • 53
-1
votes
2 answers

Play 2.0: Persist main title to database

My web app has a main title which shows up on each page. For example, the way stackoverflow will show up in the top menu on every page. Currently this title is hard coded in my main.scala.html: My Main Title I want to make this title…
nbz
  • 3,806
  • 3
  • 28
  • 56
-1
votes
1 answer

Database design for types of users

I'm planning a web system where there are mainly two types of users. My project is powered by Play! framework and ebean as the ORM layer. Now, with the OOP perspective I should create a User Model and then two more classes which extends User.…
AngryOliver
  • 397
  • 1
  • 4
  • 18
-1
votes
2 answers

Cannot create new Object from Maven dependency

I'm trying to make an Ebean ServerConfig as explained here: http://www.avaje.org/ebean/getstarted_programmatic.html But, when in my project I create a new ServerConfig object, I cannot access the methods in it. package controller; import…
Szilank
  • 26
  • 2
-1
votes
1 answer

Metasearch like library in Play Framework

When I want to offer basic searching capabilities in a web application in Rails, I install Metasearch or Ransack and am happy with it. They are simple, flexible and save me time. Now I'm developing a Java / Play Framework 2.0 application, and I…
Hans Fledermaus
  • 241
  • 1
  • 3
  • 9
-1
votes
1 answer

Ebean equivalent of SQL Query

I want an Ebean equivalent of this SQL Statement SELECT A,B,C FROM TABLE1 WHERE A BETWEEN "X" AND "Y" I have the Ebean Avaje Documentation with simple queries example Any help is appreciated. Thanks in advance :)
Incpetor
  • 1,293
  • 6
  • 25
  • 46
1 2 3
73
74