ObjectDB Database Search
51-100 of 200 resultsMulti selection and distinct in a criteria query hi, How can I realize multi selection with the criteria api concerning distinct? I.e. doing something like SELECT DISTINCT $1, $2 wouldn't work because I do only have something like criteria.multiselect(...) and nothing like builder.distinct( selection ) so that I could do something like criteria | |
Is there any faster select method? SELECT : TypedQuery query = em.createQuery( " SELECT p FROM Point p WHERE p ... ); ** the Point class is of the tutorial. I found the above select method is ten times slower ... . Is there any faster method of select ? TIA pikotenta pikotenta Entity objects can be retrieved by | |
selecting objects that have a particular key/value in persistant HashMap create a JPA query that selects such objects? Something like the following (but clearly does not work) : SELECT p FROM Person p where p.pMap['location']='California' Any thoughts? Thanks, -Adam adamMc Adam Please try the following query: SELECT p FROM Person p WHERE p.pMap | |
Wrong select results Hello, I got a realy strange SELECT problem. In explorer query " select p from Player p where p.confirmed==false", given me some results with p.confirmed==TRUE. And when I try to do (see image) " select p, p.confirmed from Player p where p.confirmed==false", I getting p-confirmed-true | |
Selecting random rows Hello is there way to get random rows? Functions like rand(), random(), newid() doesn't work ;/ for example: em.createQuery(" SELECT s FROM StawkaVat s ORDER BY rand()").setMaxResults(5).getResultList(); gives exception: Exception in thread "AWT-EventQueue-0" [ObjectDB 2.5.6_02] SELECT s FROM StawkaVat s == rand | |
Conditional Selection so when I use... SELECT firstName + " " + middleName + " " + lastName FROM Employee   ... an additional field. e.g. displayName . Use a method in the SELECT clause. It could be a static method | |
Embedded Entity in EmbeddedId not persisted. Error 631 at select.; issue: In case 1 transaction is committed, but select fails! * *   ... (em.createQuery(" select a from A a", A.class).getResultList()); }   | |
Performance in SELECT statement) Example query looks like : String strSelect = " SELECT e FROM TestEntity WHERE e.state.entityState IN | |
Unexpected query token 'delete' (SELECT is expected) (error 752) simple codes(see attachment), failed. gzdillon Lai Yang DELETE queries should not be run with getSingleResult ( which is for SELECT queries). Use executeUpdate instead. See this manual page . support Support | |
Using SELECT BETWEEN with LocalDate I am trying to query all entities whose date is between today and today + X days. The date inside the entity is a LocalDate . To do so I created the following query: .createQuery( " SELECT e FROM ... the SELECT a Date is used and not a LocalDate , so I ignored this error. Now I tried a LocalDate | |
NullpointerException at a normal select When I run the following code: EntityManager em = getEm(); Customer result = null; try { logger.debug("Ident: "+ident); result = em.createQuery(" Select c from Customer c where c.identifier=:id", Customer.class).setParameter("id", ident).getSingleResult | |
selective update not working we try to optimize for our queries and tried a selective update, but in explorer it just shows query execution error: UPDATE ObjectNode o SET o.state = 5 where o.classIdentifier = '(MA)' and o.objectNameUpper = 'DMU200P2' and o.state = 0 and o.type = 1 and o.parentNode.classIdentifier | |
JPA Entity Fields the following query, where :d represents the Department entity: SELECT e FROM Employee e WHERE e.department ... this case, the employees field is populated with the results of the following query: SELECT e FROM | |
JPA Query API and TypedQuery objects: Query q1 = em. createQuery (" SELECT c FROM Country c"); TypedQuery q2 = em. createQuery (" SELECT c FROM Country c", Country.class); In the preceding code, the same JPQL query | |
jakarta.persistence.criteria.Subquery: - the type of the selection item. Super Interfaces: AbstractQuery , Expression , CommonAbstractCriteria , Selection , TupleElement The Subquery interface defines functionality that is specific to subqueries. A subquery has an expression as its selection item. Since: Jakarta Persistence (JPA) 2.0 Public | |
jakarta.persistence.criteria.PluralJoin , From , Path , FetchParent , Expression , Selection , TupleElement The PluralJoin interface defines ... query construction. Since: Jakarta Persistence (JPA) 2.0 Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or | |
jakarta.persistence.criteria.Path referenced by the path Super Interfaces: Expression , Selection , TupleElement Represents a simple ... how to use Path . Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item | |
jakarta.persistence.criteria.MapJoin Interfaces: PluralJoin , Join , From , Path , FetchParent , Expression , Selection , TupleElement ... Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item. Inherited from Selection | |
jakarta.persistence.criteria.Root: - the entity type referenced by the root Super Interfaces: From , Path , FetchParent , Expression , Selection ... . Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item. Inherited from | |
jakarta.persistence.criteria.SetJoin , From , Path , FetchParent , Expression , Selection , TupleElement The SetJoin interface is the type ... that has been specified as a Set . Since: Jakarta Persistence (JPA) 2.0 Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or | |
jakarta.persistence.criteria.CollectionJoin: PluralJoin , Join , From , Path , FetchParent , Expression , Selection , TupleElement The CollectionJoin ... Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item. Inherited from Selection | |
jakarta.persistence.criteria.Predicate: Expression , Selection , TupleElement The type of a simple or compound predicate: a conjunction or ... how to use Predicate . Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same | |
jakarta.persistence.criteria.ParameterExpression Parameters: - the type of the parameter expression Super Interfaces: Parameter , Expression , Selection ... Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item. Inherited from | |
jakarta.persistence.criteria.CriteriaBuilder.Case.persistence.criteria.CriteriaBuilder.Case Super Interfaces: Expression , Selection , TupleElement ... which they are specified. Since: Jakarta Persistence (JPA) 1.0 Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or | |
jakarta.persistence.criteria.CriteriaBuilder.In.persistence.criteria.CriteriaBuilder.In Super Interfaces: Predicate , Expression , Selection ... Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item. Inherited from Selection Parameters | |
jakarta.persistence.criteria.CriteriaBuilder.Coalesce.persistence.criteria.CriteriaBuilder.Coalesce Super Interfaces: Expression , Selection , TupleElement ... otherwise. Since: Jakarta Persistence (JPA) 1.0 Public Instance Methods Selection alias ( String name ) Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned | |
Remove of an entry from a @OneToMany collection is not possible if the enhancer is disabledRemove of an entry from a @OneToMany collection is not possible if the enhancer is disabled | |
Setting and Tuning of JPA Queries ( name ="Country.findAll", query =" SELECT c FROM Country c", hints ={@ QueryHint (name="jakarta | |
JPA Query Expressions (JPQL / Criteria) JPQL and criteria queries are built on query expressions. Every query consists of clauses , such as SELECT , FROM , WHERE , GROUP BY , HAVING , and ORDER BY . Each clause is composed of JPQL or Criteria API expressions. Atomic expressions The atomic query expressions are: JPQL / Criteria Variables | |
Literals in JPQL and Criteria Queries types in Java. Entity type literals enable selective retrieval by type . In JPQL, an entity type | |
Step 6: Set the Spring XML editor (by right clicking and selecting Open With Text Editor or by double click ... that file: Right click the WEB-INF node in the [Package Explorer] window, select New Other... XML | |
Step 4: Add a Servlet Class In this step we will add a servlet to manage guestbook web requests: Open the [Create Servlet] dialog box by right clicking the guest package node (in the [Package Explorer] window), selecting ... of guests: List guestList = em.createQuery( " SELECT g FROM Guest g", Guest.class).getResultList | |
Step 3: Add a Context Listener Class by right clicking the guest package node (in the [Package Explorer] window), selecting New ... the class name - use exactly that case sensitive class name. Click Next and then Select All to enable | |
Step 6: Set the Spring XML clicking and selecting Edit or by double click and then moving to the XML tab in the editor window ... , select New Other... and then choose the XML category, XML Document and click Next . Enter spring | |
Step 1: Create a Maven Web Project We start by creating a new Maven web project in NetBeans: Open the [New Project] dialog box, e.g. by using File New Project... Select Maven Maven Web Application and click Next . Choose a Project Name (e.g. Guestbook ) and select Java EE 5. Enter Maven Group Id (e.g. com.objectdb.tutorial.spring | |
Step 1: Create a Java EE 6 Web Project We start by creating a new Java EE dynamic web project in Eclipse: Open the [New Project] dialog box, e.g. by using File New Project... Select Web Dynamic Web Project and click Next . Choose a Project Name (e.g. Guestbook ). Select GlassFish Server Open Source Edition 3 (Java EE 6) as the Target | |
Step 3: Define an EJB Session Bean node (in the [Projects] window), selecting New Other... Java EE (or Enterprise JavaBeans) Session ... getAllGuests() { TypedQuery query = em.createQuery( " SELECT g FROM Guest g ORDER BY g.id", Guest.class | |
Step 3: Define a Spring DAO Component clicking the guest package node (in the [Projects] window under Source Packages) and selecting New ... () { TypedQuery query = em.createQuery( " SELECT g FROM Guest g ORDER BY g.id", Guest.class); return | |
Step 3: Create an ObjectDB Data Source Connections to the database are represented in BIRT as data sources. To create an ObjectDB data source: Open the [New Data Source] dialog box by right clicking the Data Sources node in the [Data Explorer] window and selecting New Data Source . Select ObjectDB Data Source from the list | |
Step 6: Design a BIRT Report Table) layout. Set the column number to 2 , number of details to 1 , select the data set (e.g. Points by X ... in the [Navigator] window and selecting Report Run Report : | |
Step 3: Define a Spring DAO Component clicking the guest package node (in the [Package Explorer] window) and selecting New Class ... getAllGuests() { TypedQuery query = em.createQuery( " SELECT g FROM Guest g ORDER BY g.id", Guest.class); return | |
Step 5: Add a JSP Page In this step we will add the JSP that generates the guestbook HTML output: Open the [New JSP File] dialog box by right clicking the WEB-INF node under the Web Pages node (in the [Projects] window) and selecting New JSP ... Enter guest as the jsp file name - use exactly that case sensitive class | |
Step 4: Run the Application You can run the application now by right clicking the Main node (in the [Projects] window) and selecting Run File . The expected output in the [Output] window, is: Total Points: 1000 Average X: 499.5 (0,0) (1,1) (2,2) (3,3) : : (998,998) (999,999) When you run the application for the first time | |
Step 4: Add a Controller Class In this step we will add a Spring Controller to manage guestbook web requests: Open the [New Java Class] dialog box by right clicking the guest package node (in the [Package Explorer] window) and selecting New Class . The package name should be guest . Enter GuestController as | |
Step 2: Define a JPA Entity Class To store objects in an ObjectDB database using JPA we need to define an entity class: Right click on the project in the [Package Explorer] window and select New Class . Enter tutorial as the package name (case sensitive). Enter Point as the class name (case sensitive). Click Finish to create | |
Step 2: Define a JPA Entity Class To store objects in an ObjectDB database using JPA we need to define an entity class: Open the [New Java Class] dialog box, e.g. by right clicking the tutorial package node (in the [Projects] window) and selecting New Java Class ... Enter Point as the class name - use exactly that case sensitive | |
Step 6: Run the Java EE 6 Application You can run the application now by right clicking the GuestServlet node (in the [Project Explorer] window) and selecting Run As Run on Server Finish : Since we are using ObjectDB in embedded mode - the database file is created under the GlassFish directory (e.g. at domains\domain1\eclipseApps | |
Step 5: Add a JSP Page In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the Web Pages node (in the [Projects] window) and selecting New JSP ... Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish | |
Step 4: Run the Application You can now run the application by right clicking the Main.java file (in the [ Package Explorer ] window) and selecting Run As Java Application . The expected output in the Eclipse [Console] window, is: Total Points: 1000 Average X: 499.5 (0,0) (1,1) (2,2) (3,3) : : (998,998) (999,999 | |
Step 6: Run the Web Application You can run the application now by right clicking the GuestServlet node (in the [Project Explorer] window) and selecting Run As Run on Server Finish : Since we are using ObjectDB in embedded mode - the database file is created under the Tomcat directory. You can stop the Tomcat server and open |