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
1 answer

Hibernate 3.2.1 and EJBQL query within query

I'm trying to make sure the following is supported with the EJBQL capabilities in hibernate 3.2.1, but my google-fu has failed me. All I found was that nested queries aren't supported in EJB 2.x Can I put a query within a query like this: select…
Robert
  • 247
  • 4
  • 12
1
vote
0 answers

Error executing Seam EJBQL - "java.lang.IllegalStateException: invalid select clause for query"

I'm trying to run a ejbql in my application but it's failing with the following error: java.lang.IllegalStateException: invalid select clause for query. This is the query: public void pesquisar() { StringBuilder query = new…
PauloBueno
  • 112
  • 2
  • 14
1
vote
2 answers

EJB QL Syntax error

In my app, I have the following 2 entities: @Entity @Inheritance(strategy=InheritanceType.JOINED) public class Commentable implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) protected Long id; protected…
Mr.J4mes
  • 9,168
  • 9
  • 48
  • 90
0
votes
1 answer

Can EJBQL Named Paremeters be Repeated in a Query?

Just a quick one. If I'm using an EJBQL query with named parameters, can I use the same parameter name twice in a single query to avoid having to set the value twice when I actually want to run the query? For instance, I'd like to be able to do…
aroth
  • 54,026
  • 20
  • 135
  • 176
0
votes
1 answer

HibernateEntityQuery and EJBQL restrictions

I've just inherited some code that uses HibernateEntityQuery and EJBQL restrictions. There's an "activity" table/entity with various fields, and the existing EJBQL restrictions look like: private final String[] SEARCHRESTRRICTION = { …
George Armhold
  • 30,824
  • 50
  • 153
  • 232
0
votes
1 answer

How to load JPA entites via dynamic EJB-QL from standalone cache, without hitting the database

I've got a JPA entity that is loaded via dynamic ejb ql queries that can be configured by the user fairly freely. In comes a new requirement: Users should be allowed to create new entities only iff these new entites would be returned by their user…
Tim van Beek
  • 385
  • 3
  • 12
0
votes
1 answer

is there a way to programatically determine the EJB entity class and id column from the table name?

is there a way to programatically determine the EJB entity class and id column from the table name? I have the table name, what I want is a way to get the entity class name and the name of the id column from the table name. Is this possible? Each…
Jim Ford
  • 1,095
  • 1
  • 13
  • 21
0
votes
1 answer

Ejbql query with in in where clause

I try to do this query : SELECT x FROM CompteUtilisateur x, Mail m WHERE m.adresse = :param_mail AND m IN (x.listeMail) I fails, query generated for the WHERE clause is : where compteutil0_.id=listemail2_.fk__compte__id and…
flow
  • 4,828
  • 6
  • 26
  • 41
0
votes
0 answers

Java EJBQL Collection(List)

I begin to learn how to use collections/Entity Classes. I just made the Entity classes from the Word (Default MySql Database) database. I Wanna make a List of Citis and print it on the console, but i just had no ide how to do it. Please if someone…
digitalized
  • 59
  • 1
  • 10
0
votes
1 answer

EJB QL data Syntax error

I am trying to retrieve all the entity from the TransactionE t entity where the month of t.purchasedDate is equal to the current month. However, I encountered a syntax error when my code run. String query = "SELECT t FROM TransactionE t WHERE…
Lawrence Wong
  • 1,129
  • 4
  • 24
  • 40
0
votes
1 answer

Wrong Oracle SQL script generation from EJB QL

I have this query SELECT acc.Id FROM Auth as auth, AccId as acc WHERE acc.ownId.Id = auth.Id AND acc.disabled = 0 Which appears to have been generated correctly: org.eclipse.persistence.exceptions.DatabaseException Internal Exception:…
alerya
  • 3,125
  • 3
  • 28
  • 50
0
votes
1 answer

What is the correct syntax for an ejbql query that traverses four levels of many to one relationships

I have a simple data model in JPA (hibernate) consisting of many to one and one to one relationships similar to this: town -> state -> governor -> nation -> continent where town is many to one to state, state is one to one to governor, governor is…
Category6
  • 516
  • 5
  • 19
0
votes
1 answer

EJB-QL Query List inside Object

I'm attempting to write what should be a simple (I hope) EJB-QL query. Here are my objects: public class Room { private String name; private List configs; } public class RoomConfiguration { private Integer…
KevMo
  • 5,590
  • 13
  • 57
  • 70
0
votes
1 answer

Querying record by date (01 may 1916) on Oracle using Java/EJB 2.x

I have an EJB 2.1 entity bean that queries a "date of birth" column in an Oracle table. The column in the database is of type DATE. The query works without problems except for one specific date: 01 may 1916. This has something to do with daylight…
Richard Kettelerij
  • 2,049
  • 14
  • 17
0
votes
1 answer

SEAM ENTITYQUERY - Problems with Restriction seam-gem example

My project was originally generated by seam-gen and the action "List" bean is not working as i expected. The restriction array has all the attributes from table and is behaving as if all the parameter were mandatory. See the List Bellow: package…
Cateno Viglio
  • 407
  • 11
  • 25