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.
1,102
questions
0
votes
0
answers
13
views
Why data inside database is deleting after running ebean.mysqldatabase.ddl.run=true?
I'm making project using SpringBoot and Ebean orm with MySql Database. I have created few tables in database. Now I wanted to add the column in existing table without deleting past records which is ...
0
votes
0
answers
26
views
Temporary backup tables, if process fails restore
I have an application that periodically downloads a large XML and saves it into a database. What is the proper way to deal with failure during the insertion process. Current process:
download XML
...
0
votes
0
answers
14
views
Using ValidateWith in Play Framework and ebeans
I am posting a Play! 1 project to Play! 2.8.
I used a lot of validation classes, which use e.g. the object (Model) and the new value to assert if it is allowed.
An example of the Play 1 validator:
...
0
votes
0
answers
43
views
Subquery in ebean
I am faced with the problem of forming subqueries in ebean. I need to compose a query that is similar to the following sql:
select sum(money), count(name) from (
select owr."clientName" ...
0
votes
0
answers
9
views
ebean - How to get the cluster status/health?
I'm configuring ebean clustering for cache invalidation (with ebean-k8scache to be specific) and I want to monitor and report the cluster's health. Digging through ebean's API I couldn't find a way to ...
0
votes
0
answers
24
views
Why is a referenced entity with one of the composite ID columns being null is still created?
Using ebean in kotlin, I have 2 tables and corresponding entity classes:
table image_package (
id int,
user_id int,
firm_id int, // this is nullable
...
)
table firm_user (
user_id int, // ...
0
votes
0
answers
46
views
Ebean: id not being generated when saving new row
After an Ebean upgrade (upgrading to 11.45.1), my code has stopped working.
final DbFilter dbFilter = new DbFilter();
dbFilter.setType(DbFilterType.EMAIL);
dbFilter.setValue(name);
dbFilter....
0
votes
1
answer
74
views
Ebean with unidirectional OneToMany relationship causing duplicate column exception during insert
I have a table ENTRY with unique id UID. A second table PROGRAM with ID column as the key and PROGRAM_LIST_UID foreign key that refers to UID in ENTRY. I did not create the names, this is legacy code ...
0
votes
1
answer
41
views
How to use double database in Play Framework with Ebean
I'm brand new with Play Framework and with Ebean. I need to configure a Play application to use two different database instances, one for reading and another for writing. I have been looking in it ...
-1
votes
1
answer
234
views
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 using:
...
2
votes
2
answers
263
views
Fetch several OneToMany relations in Hibernate (opposed to Ebean fetch)
I have a production project, that uses pretty old Ebean ORM (came from Play Framework). Out team decided to look for a migration to newer tools.
In our code we have a lot of ORM Models, and it is ...
0
votes
1
answer
126
views
I'm getting NoSuchMethodError where play.db.ebean.getReflectionsConfiguration calls org.reflections.util.ConfigurationBuilder.filterInputsBy
When running an application ported from Play 2.5 to Play 2.8 I get the following error:
! @7igpea0lh - Internal server error, for (GET) [/] ->
at play.core.server.DevServerStart$$anon$1.reload(...
3
votes
1
answer
404
views
NullPointerException: Testing DAO class that uses Ebean with Mockito and JUnit, Kotlin
So I have a quite basic model, dao, and controller classes written in kotlin. I am using Ebean to connect the service and data. I am trying to create unit tests for my DAO classes. To my understanding ...
0
votes
1
answer
36
views
Ebean database model with a serialized object column
I am using playframework with ebean.
I have the following model:
public class MailData {
private String title;
private String body;
}
public class Envelope extends Model {
@Id
private UUID id;...
1
vote
2
answers
668
views
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "Symbol" [duplicate]
I am trying to take some JSON that looks like this (from AlphaVantage):
{
"Symbol": "IBM",
"AssetType": "Common Stock",
"Name": "...
0
votes
1
answer
18
views
Ebean query seems to stop execution
I am trying to do a fairly simple Ebean query:
Long articleId = Long.parseLong(dataFetchingEnvironment.getArgument("id"));
System.out.println("Article ID");
System.out.println(...
0
votes
0
answers
84
views
ebean with db2 transaction isolation=none ignored
ebean overrides transaction isolation=none in the connection string and uses some level of transaction isolation. This is resulting in java.sql.SQLException: [SQL7008]. For reasons out of my control ...
2
votes
0
answers
120
views
@UniqueConstraint: Array constants have to be specified using the `Array(...)' factory method
I'm using the @UniqueConstraint annotation on a User model:
@Table(
name = "users",
uniqueConstraints = @UniqueConstraint(
columnNames = { "building_id", "pin&...
0
votes
1
answer
67
views
High Number of commits through Ebean
I am working on an application with high number for DML operations due to which log file sync wait event is observed. We are using ebean framework for querying the Oracle database. I was looking for a ...
1
vote
0
answers
80
views
Property not found error in ebean derived model
I have a very simple Ebean model :
@MappedSuperclass
public abstract class BaseEntity extends Model {
@Id @GeneratedValue(strategy = IDENTITY)
public int id;
@WhenCreated
@Column(name = &...
1
vote
0
answers
86
views
Ebean RawSql does not allow named parameters in "case when" clause
I've encountered a problem while working with Ebean RawSql query. Here's a simple example.
Finder<Long, Test> finder= new Finder<>(Test.class);
String query = "SELECT t.ID AS t_id, t....
0
votes
0
answers
36
views
How to create a one-to-one relationship for creating a "status" database table for another table that needs to keep record of those statuses
I have a database table: Admin(id, name, status_id) fields and another AdminStatus(id, code, description). I initially though of creating a one-to-one relationship by creating a unique constraint on ...
0
votes
1
answer
74
views
How do I pull records RANDOMLY in MySQL using the Ebean ORM?
I have a requirement where I have to pull a random set of records from a MySQL table and this can be achieved by using the RAND() method inside the SQL query as shown below:
SELECT Id
FROM table1
...
2
votes
1
answer
361
views
How to use multiple databases with ebean
I'm trying to use Ebean framework ORM queries to different postgres databases.
Following these and these docs, queries to my single database works fine. But to address another one, I have to ...
0
votes
1
answer
26
views
Looking for sample with @ManyToMany + Repository completion stage
Can you give me an example of a project that covers @ManyToMany with the use of Repository (Completion Stage)
Thank you so much
0
votes
1
answer
605
views
Multiple queries in the same view
I would like to run multiple queries then show results in a page such as :
https://adminlte.io/themes/v3/index.html
I create a first controller query :
package controllers;
import models.Sysuser;
...
1
vote
0
answers
25
views
Playframework 2.6.x FormUrlEncoded return null value in post action
I tried to extract some manytomany values with
request().body().asFormUrlEncoded().get("RolesItems");
But it seems to return a value here :
//DELETE Roles from Sysuser
public Result DeleteRoles(...
0
votes
1
answer
37
views
Ebean doesn't recognize plus (+) operator in where clause
I am using Ebean 11.32.x (PlayEbean plugin 5.0.1 for Play Framework 2.7.2).
I would like to use the plus (+) operator in the where clause for filtering, e.g. " where cost >= 50 and ((regA >=1 ...
0
votes
1
answer
29
views
EBeans update does not save changed field items
I upgrade from Play 2.5 to 2.7, and am having a problem with saving my forms.
When fields are changed and I call the Model.update() the changes are not persisted in the database (even though they show ...
0
votes
2
answers
111
views
EBean enhancement issue [POJO not enhanced]
I am Using Ebean and Vert.x for my cron jobs.
But for some reason Entities are not being enhanced by ebean-maven-plugin.
Here is what I am using:
<plugin>
<...
-2
votes
1
answer
2k
views
Unsupported conversion from DATE to java.lang.Integer
So, I have the following model generated using Java Ebean library:
package models;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax....
2
votes
0
answers
44
views
Ebean doesn't work with jakson annotation in java
I have class:
@Entity
@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
public class Users extends Model {
@Id
private String id;
private String fullName;
...
1
vote
0
answers
39
views
Ebean not loads Foreign Key object on second instance of play framework application
I am running two instances of a play! framework app in my localhost on different ports say 9000 and 9001.
Suppose I have class A which has a foreign key to class B. (A is a member of B)
My weird ...
1
vote
0
answers
19
views
Ebean return records if list is subset of another list
I am new to using Ebean and needed some help writing a query. For reference I am using Ebean 3.2 with Postgres.
Right now I have an 'Alert' Model that is defined as such:
@Entity
public class Alert ...
0
votes
1
answer
215
views
Ebean Error when ending a query only transaction via COMMIT
There's an error in our system which uses ebean for DB communication and queries.
The error we see is this:
30/01/2020 INFO 1 --- [nio-8090-exec-8] io.ebean.datasource.pool.ConnectionPool : ...
0
votes
1
answer
32
views
How to search in h2 database Play Framework 2.7.3?
I need to search in an h2 database for Company class instances that have a specific code, but I can't figure out how.
I have tried using the Finder class, but there don't seem to be any find methods ...
1
vote
0
answers
136
views
How to configure Ebean clustering?
I want to use Ebean's L2 cache. The problem is I have multiple instances of service all looking at the same database, so I need a way to invalidate the cache across the cluster. If an object was ...
1
vote
1
answer
170
views
play framework runs all DOWN scripts of evolutions then applying all UPs in reverse order which destructs tables
I am using play framework and wondering a problem in evolutions. After I changed my models (e.g. add a field), I prepare proper sql script (both for UPs and DOWNs) e.g. 3.sql (assuming I have already ...
0
votes
1
answer
28
views
tornadofx data binding when using eBean ORM
using ebean how can i bind itemModelView with model
@Entity
class Person(
):Model(){
@Id var id:Long=0
var name:String?=null
var title :String?=null
val idProperty = ...
1
vote
2
answers
121
views
Ebean not fetch oneToMany relationship
I have a Post entity that has a testattribut type attribute with the following code:
@Entity
public class Post extends Model {
@Id
private long id;
@ManyToOne
private PostType ...
0
votes
1
answer
187
views
Multiple levels of cascading persists in Ebean
I have a model class which defines a list of children that are models of the same class. Persisting a new object with some initial children works fine, but when I have two or more levels of children ...
1
vote
1
answer
111
views
Order by clause not working for string in Play Ebean
I want to order the list bases on string but ebean is giving an error. here is my query.
ExpressionList<Application> query = find.query()
.where();
query.setFirstRow(start * ...
0
votes
0
answers
65
views
Is there any way to get List of Objects filtered by jsonb field from raw sql in Ebean
I try to get some records from DB that equals a few conditions(one of them is jsonB field). When I try do it in postgres - its works. But when I do it from java code I got postgres cast error and I ...
0
votes
1
answer
32
views
how to show specific field use ebean relation
...
is my code
@ManyToOne
@JoinColumn(name = "destination_country_id", referencedColumnName = "id", table = "countries", insertable = false, updatable = false)
public Country country;
.....
0
votes
2
answers
233
views
Ebean select function always taking id column only
In Ebean select(String properties) function always taking id of the table. I know select function take id default but in my case although i am giving different properties(column name) it is taking ...
0
votes
1
answer
406
views
JPA Attribute Converter being applied despite autoApply=false and property not annotated with @Convert
The system I'm working on has a bunch of legacy data where boolean values have been stored as 'Y' and 'N'. New tables use a BIT column instead and simply store 0 and 1. No table mixes the two ...
0
votes
0
answers
374
views
Database 'default' is in an inconsistent state
I am using Play framework 2.7.3, and evolution is always creating wrong sql no matter what I do
I tried to edit generated sql, but after loading the project evolution is becoming the way it was ...
0
votes
1
answer
223
views
Entity bean not enhanced error when deploying cxf soap war file to weblogic 12.2.1
I created two Entity Beans that will insert user data to a mysql database when a user logs in and when a user is billed. I decided to use Ebean ORM since, it's "lighweight" for just a table insert.
...
1
vote
0
answers
116
views
How to use 2 datasources with Ebean on a Play Framework 2.5 project?
I would like to split my default datasource to 2 different datasources (2 databases). I set my application.conf file:
db {
common.driver = org.mariadb.jdbc.Driver
common.username = "root"
...
0
votes
1
answer
699
views
Database 'default' needs evolution! when trying connect to MySQL with play framework 2.7.0 and Ebean
I'm trying to set up a project using play framework 2.7.0, now I'm trying to connect to MySQL database using sbt-play-ebean 5.0.0.
Here is my code.
https://github.com/hiroya8649/play-mysql-ebean-test
...