Questions tagged [ejbql]

EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence.

EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. EJB QL is introduced in the EJB 2.0 specification. The EJB QL query language defines finder methods for entity beans with container managed persistenceand is portable across containers and persistence managers. EJB QL is used for queries of two types of finder methods:

  1. Finder methods that are defined in the home interface of an entity bean and which return entity objects.
  2. Select methods, which are not exposed to the client, but which are used by the Bean Provider to select persistent values that are maintained by the Persistence Manager or to select entity objects that are related to the entity bean on which the query is defined. From the EJB
52 questions
1
vote
2 answers

Hibernate: Conditional query not evaluated correctly

I'm trying to get the following query to work in Hibernate: SELECT m FROM MyEntity m WHERE m.owner = :user AND m.field1 IN (:field1Vals) AND m.field2 IN (:field2Vals) AND…
aroth
  • 54,026
  • 20
  • 135
  • 176
1
vote
1 answer

LEFT JOIN tables with EJBQL

I am trying to join two EJB's using EJBQL (with an underlying MySQL data source). The two tables in question are Machine - Hostname - ... unrelated fields ... and Location - Code - Human readable description The tables should be LEFT joined…
debracey
  • 6,517
  • 1
  • 30
  • 56
1
vote
0 answers

Upload Report with ejbql Data Adapter in JasperSoft Server

I've created a report using JasperSoft Studio, and it works fine using a EJBQL Data Adapter with an EJBQL Query. But now, I need this report to be called from Jaspersoft Server, but I can't figure out how I can setup the EJBQL Data Adapter in the…
1
vote
6 answers

Toplink bug. Empty result for valid sql with not empty result

How is it possible? We are executing EJBQL on Toplink(DB is Oracle) and query.getResultList is empty. But! When i switched log level to FINE and received Sql query, that TopLink generates, i tried to execute this query on database and (miracle!) i…
Sergey Vedernikov
  • 7,609
  • 2
  • 25
  • 27
1
vote
2 answers

EJB-QL question how would I set a list as a parameter like: select o from table where id in (List listOfIds)

IN EJB-QL I am trying to create a query like this: SELECT * FROM table WHERE id IN ([id1],[id2],[id3],...); This is a normal query for oracle or mysql but how can I make EJB-QL set parameters as a list? SELECT o FROM ClassName WHERE…
Jim Ford
  • 1,095
  • 1
  • 13
  • 21
1
vote
1 answer

Why isn't this EJBQL query validated by JBoss 5?

I am migrating an existing application from Weblogic server 9 to JBoss 5. My problem is with a query that has a character condition in the WHERE clause, like this one: SELECT DISTINCT OBJECT(myObject) FROM MyObject myObject WHERE…
Sébastien
  • 548
  • 1
  • 6
  • 19
1
vote
1 answer

How to rename the fields of ejbql query in ireport?

I'm using iReport 3.7.3 with ejbql connection. My problem is when I want to get the fields from the query, the ireport sets the name of the fields with "COLUMN_1", "COLUMN_2" even if I use the sentence "as" the ireport gets me that name to the…
Jorge
  • 17,896
  • 19
  • 80
  • 126
1
vote
1 answer

How do I use a EJBQL between query with two identical dates?

I have a JPA named query that takes two dates in order to return records with a date column entry between the two dates. If I enter the same date for both the start and end dates it returns no rows, even though there are records for that date. Is…
blank
  • 17,852
  • 20
  • 105
  • 159
1
vote
1 answer

EJBQL date comparison

In EJBQL how can compare two date values; suppose "Select e from Employee e where e.start_date > :start_date" If I set query parameter with setParameter("start_date", new Date()); An Exception occurs on running.. I wait for your suggestions
whoi
  • 3,281
  • 7
  • 36
  • 44
1
vote
2 answers

Could I order in EJBQL by a function which is not mapped to a column in database?

I would like to order a query by a function which uses properties of the class. Something like: @entity class A { private int id; private String name; public int StringLength() { return name.length(); } } And the sentence something like: select n…
Pablo Castilla
  • 2,723
  • 2
  • 28
  • 33
1
vote
2 answers

Is it possible to test a JPA/EJB QL statement with regex?

I'm not an expert on regular expressions so I thought I'd throw this question out. I'm thinking regular expressions can help make my tests more robust (testing generated EJB QL statements for correct generation). For example: select u.firstName,…
aberrant80
  • 12,815
  • 8
  • 45
  • 68
1
vote
2 answers

Data structure to hold HQL or EJB QL

We need to produce a fairly complex dynamic query builder for retrieving reports on the fly. We're scratching our heads a little on what sort of data structure would be best. It's really nothing more than holding a list of selectParts, a list of…
aberrant80
  • 12,815
  • 8
  • 45
  • 68
1
vote
0 answers

Queries in EJB QL Collection Member Comparison

I need to write the following sql query, in EJBQL. SELECT * FROM teacher t left join student_class sc on t.id_teacher = p.id_student_class where t.login = 01325 and sc.id_student_class = 3; In the class bean Teacher, there is the following…
1
vote
2 answers

Selecting random rows from database with ejb ql

I'm developing a web application for advertising real estates. On the search page i'd like to show some random advertisements, but so far I've had no success with selecting random records from the database. This worked in the console, but i couldn't…
Peter
  • 1,047
  • 2
  • 18
  • 32
1
vote
1 answer

Ejb Finder(ejb-ql) Transaction TimesOut

We have been facing an issue, where a simple ejb-ql query runs out of transaction time, if same(WL generated SQL version of ejb-ql) is run from SQL command prompt, it takes very less time than the configured JTA time(execute less than 5% time of…