ObjectDB Database Search
1-50 of 200 resultsGrouping by date()
have to group by date(). For few queries I was concatenating 'date' from year()-month()-day() calls ... with new version. When you group by date() there are two days per day. I mean group by divides each day ... with this issue. Query: select hour(ov.created), count(ov) from ObjectView ov group by hour(ov.created) order by
|
|
Group by date / time
Hi, I'm trying to create reporting query that will return entities grouped by year / mont / day ... WHERE YEAR(record_date) = 2009 GROUP BY YEAR(record_date), MONTH(record_date) or maybe something like this: SELECT COUNT(id) FROM stats WHERE YEAR(record_date) = 2009 GROUP BY DATE_FORMAT(record_date
|
|
Group by: list if no aggregate function is specified
Hello! In a query like SELECT parent, children FROM Parent parent LEFT JOIN p.children children GROUP BY parent maybe it would be good if it will return a list of Object[2], where the second object is a list of children of a parent. Because creating a query to get a list of parents
|
|
JPA Entity Fields
superclasses) can be classified into the following five groups : Transient fields Persistent fields Inverse ( mappedBy ) fields Primary key (ID) fields Version field The first three groups (transient ... . However, the last two groups (primary key and version fields) can be used only in entity classes. Primary key
|
|
JPA Query Structure (JPQL / Criteria)
of up to six clauses in the following format: SELECT ... FROM ... [WHERE ...] [ GROUP BY ... [HAVING ... and delete queries have a slightly different structure. The other JPQL clauses-- WHERE , GROUP BY ... ) Criteria WHERE ( where ) Criteria GROUP BY / HAVING ( groupBy , having , count , sum , avg , min
|
|
FROM clause (JPQL / Criteria API)
By default, the name of an entity class in a JPQL query is the unqualified name of the class (for example, Country with no package name). The default name can be overridden by specifying another name ... to a single-value expression are less commonly used because they can usually be replaced by
|
|
find repeated records by JPQL
in #1 contains GROUP BY / HAVING. The outer query in #1 contains the IN operator. The query in #3 ... get the point since in #3 there is no GROUP BY / HAVING. support Support ... (select id from TTT s group id having count(id)1) I dont know how to do this using JPQL, but I use
|
|
jakarta.persistence.criteria.CriteriaQuery
getGroupList () Return a list of the grouping expressions. Returns empty list if no grouping ... AbstractQuery Returns: the list of grouping expressions. Since: Jakarta Persistence (JPA) 1.0 Predicate getGroupRestriction () Return the predicate that corresponds to the restriction(s) over the grouping items
|
|
Problem with distinct select, order by and equivalent alias/attribute path
, and will except the query above. However, in DISTINCT and GROUP BY queries it must follow these restrictions ... when ordering the results of some projection when the order by expression is different (though logically ... ; + "order by s_location.id asc";  
|
|
JPA Criteria Queries
to define SELECT, WHERE , GROUP BY , and ORDER BY clauses. To execute the query, pass the instance ... ; CriteriaQuery , CriteriaUpdate , and CriteriaDelete are first built by static methods ... (Note: Subqueries are currently not supported by ObjectDB). Top-level queries and subqueries share
|
|
DELETE Queries in JPA/JPQL
cannot include multiple variables, JOIN clauses, or the GROUP BY , HAVING , and ORDER BY clauses ... As explained in Chapter 2 , you can delete entities from the database by following these steps ... within an active transaction, either explicitly by calling the remove method or implicitly through a cascading
|
|
JPA Named Queries Annotations
. A container annotation that groups multiple @NamedQuery definitions on a single class. Supplies parameters ... of the ObjectDB Manual. Query references Access named queries in the application by name or by using ... . Retrieve it by result type from EntityManagerFactory.getNamedQueries , and use it to get a TypedQuery instance via EntityManager.createQuery .
|
|
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 ... of at least one atomic component. More complex query expressions are built by combining atomic expressions
|
|
Auto Generated Values
is global to the application and can be used by multiple fields across different classes. Specify ... value earlier. To minimize round trips to the database server, IDs are allocated in groups ... Hibernate, TopLink, EclipseLink, and OpenJPA) simulate a sequence by using a table to support
|
|
JPA Extended API Reference Guide
Jakarta Persistence API (JPA) 3.2 documentation, generated from the official JavaDoc and enriched with practical notes. It groups the API types into logical sections to help you locate core concepts ... model and entity behavior. Documents the exception hierarchy thrown by JPA to indicate errors
|
|
Help with JPA2 Criteria and conditional operator grouping
; ))); System.out.println("Query: " + c); But I can can never get the grouping to occur ... persistence.xml shows the grouping happening. I've had to dumb down the domain model enough to convey ... . support Support That fixed the conditional grouping issue. Thanks. There is a new problem now however, I'll create a new post Willks William
|
|
ObjectDB Roles and Groups
Hello, How can I incorporate roles/ group in ObjectDB config file? I see no support for this. For example, I would like to place several users under a given group or role, but I see no way of doing this as no such element is present in the config file. Is it possible to have this? st.clair
|
|
SQL Queries Annotations
dialect. Groups multiple @NamedNativeQuery definitions on a single class. Result set mapping Map ... how the result set of a native query maps to entities, scalar values, or constructor results. Groups
|
|
jakarta.persistence.criteria.Subquery
() Return a list of the grouping expressions. Returns empty list if no grouping expressions ... : the list of grouping expressions. Since: Jakarta Persistence (JPA) 1.0 Predicate getGroupRestriction () Return the predicate that corresponds to the restriction(s) over the grouping items, or null
|
|
jakarta.persistence.criteria.AbstractQuery
(JPA) 1.0 List getGroupList () Return a list of the grouping expressions. Returns empty list if no grouping expressions have been specified. Modifications to the list do not affect the query. Returns: the list of grouping expressions. Since: Jakarta Persistence (JPA) 1.0 Predicate
|
|
jakarta.persistence.EntityManagerFactory
of EntityManager . A persistence unit defines the set of all classes that are related or grouped by ... may be defined by a persistence.xml file, or it may be defined at runtime ... . An EntityManagerFactory with a lifecycle managed by the application may be created using the static operations
|
|
jakarta.persistence.MapKeyJoinColumns
. The MapKeyJoinColumns annotation groups MapKeyJoinColumn annotations. When the MapKeyJoinColumns annotation ... of the grouped MapKeyJoinColumn annotations. See Also: MapKeyJoinColumn ForeignKey Since: Jakarta Persistence ... in either location, a default foreign key strategy is selected by the persistence provider. Default
|
|
Apache License, Version 2.0, January 2004
the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright ... and all other entities that control, are controlled by , or are under common control with that entity
|
|
Privacy Policy
the Service. By using the Service, You agree to the collection and use of information in accordance ... files that are placed on Your computer, mobile device or any other device by a website, containing ... individuals employed by the Company to facilitate the Service, to provide the Service on behalf
|
|
jakarta.persistence.JoinColumns
groups JoinColumn annotations for the same relationship. Each JoinColumn annotation must explicit ... is selected by the persistence provider. Default: @ForeignKey(PROVIDER_DEFAULT) Since: Jakarta
|
|
jakarta.persistence.ConstructorResult
" + "WHERE o.cid = c.id " + " GROUP BY c.id, c.name", "CustomerDetailsResult"); @SqlResultSetMapping( name
|
|
JPA Persistable Types
are represented in queries by entity names . By default, the entity name is the unqualified name ... can be set explicitly by using the name attribute of the @Entity annotation: @Entity ( name ="MyName ... is declared as embeddable by marking it with the @Embeddable annotation: @Embeddable public class Address
|
|
Retrieving JPA Entities
the no-argument constructors of entity classes and keep them as simple as possible. Retrieval by class and primary key Every entity can be uniquely identified and retrieved by the combination of its class ... is similar to the find method, but if the entity is not already managed by the EntityManager
|
|
Eclipse Public License - v 1.0
additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or ... entity that distributes the Program. "Licensed Patents" mean patent claims licensable by
|
|
Blocked by find
, Object obj)" method which is synchronized and attempts to load an object by id using the EntityManager ... : BLOCKED on rbccm.felix.objectdb.workflow.ObjectDbInstanceContainer@9c71a4 owned by : DEV1-WSAgent-1 ... @254e85f4 owned by : ODB-FileWriter Total blocked: 789 Total waited: 616 Stack trace: com.objectdb.o
|
|
Database Management Settings
for each new database file. The resize attribute specifies the size by which to extend the database ... can improve performance by reducing file fragmentation that can result from frequent resize operations ... environments. By default, the recovery file is created in the same directory as the database file
|
|
JPA Class Enhancer
The ObjectDB Enhancer is a post-compilation tool that improves performance by modifying ... directly accessing persistent fields of other classes. This practice is required by the JPA specification but not enforced by ObjectDB. Instead, use the accessor and mutator methods of the desired class
|
|
jakarta.persistence.criteria.AbstractQuery.groupBy(List)
groupBy ( List grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. Parameters: grouping
|
|
jakarta.persistence.criteria.Subquery.groupBy(Expression...)
; Expression ... grouping ) Specify the expressions that are used to form groups over the subquery results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method
|
|
jakarta.persistence.criteria.AbstractQuery.groupBy(Expression...)
groupBy ( Expression ... grouping ) Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. Parameters
|
|
jakarta.persistence.criteria.Subquery.groupBy(List)
; List grouping ) Specify the expressions that are used to form groups over the subquery results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides
|
|
Query Parameters in JPA
a Country object from the database by its name: public Country getCountryByName( EntityManager em ... a value for the parameter by using the setParameter method. The setParameter method supports method chaining by returning the TypedQuery instance on which it was invoked. This allows you to chain
|
|
Storing JPA Entities
Using Jakarta Persistence (JPA) You can store new entities in the database either explicitly by ... . The exception is thrown either by persist , if the existing entity is currently managed by the EntityManager , or by commit . Referenced embedded objects The following code stores an Employee instance
|
|
Step 1: Create a Maven Web Project
We start by creating a new Maven-WTP dynamic web project in Eclipse: Open the [New Project] dialog box, e.g. by using File New Project... Select Maven Maven Project and click  ... Next . Enter Group Id (e.g. Guestbook ), Artifact Id (e.g. Guestbook ), Version (e.g
|
|
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
|
|
[ODB1] Chapter 3 - Persistent Classes
group , should not be accessed by this method. void jdoPreStore() Called when a persistent object ... that are not in the default fetch group should not be accessed by this method. void jdoPreDelete() Called ... store methods and code. Only the state of the object as reflected by its persistent fields is stored
|
|
[ODB1] Chapter 9 - ObjectDB Explorer
\odbfe.jar my.odb Some JVM arguments can be useful. For instance, by default Java does not use ... . Otherwise, the required executable jar would not be found by explorer.exe. By default, running explorer.exe ... Local Files" menu command. By default, when the Explorer starts its opens the last used local database
|
|
Detached JPA Entities
Detached entities are objects in a special state where they are not managed by an EntityManager ... have limited functionality: Many JPA methods, for example, lock , do not accept detached objects. Retrieval by ... EntityManager instances. Explicit detach You can detach an entity by using the detach method: em
|
|
JPA Connections and Transactions
A connection to a database is represented by an EntityManager instance, which also provides methods ... connection by using a separate EntityManager instance for each HTTP request. The main role ... transactions. Transactions are managed by an EntityTransaction instance, which is obtained from
|
|
Support for roles/groups in ObjectDB
ObjectDB should incorporate roles/ group in ObjectDB config file? I see no support for this. I would like to place several users under a given group or role, but I see no way of doing this as ... , there could be a role/ group element which would categorise the user further. This would help in authentication. Thanks st.clair.clarke St Clair Clarke
|
|
SELECT clause (JPQL / Criteria API)
query returns Country objects, which then become managed by the EntityManager instance em : TypedQuery ... directly. However, you can add their content to the SELECT clause by using a bound JOIN variable in ... with the containing entities. Therefore, embedded objects that are retrieved directly by a result path expression
|
|
Setting and Tuning of JPA Queries
method specifies the starting point of the result window by defining how many results to skip from ... because the setter methods in Query and TypedQuery support method chaining by returning the query object on which they were invoked. Flush mode (setFlushMode) Changes made to a database by using an EntityManager
|
|
[ODB1] Chapter 6 - Persistent Objects
When a new object is constructed by the new operator, it always starts as a transient object, regardless of its type. Instances of persistent classes can become persistent later, as demonstrated by ... . Then it becomes persistent by an explicit call to the makePersistent( ... ) method. When a transient
|
|
[ODB1] Chapter 8 - ObjectDB Server
An ObjectDB server can manage one or more databases. Databases that are managed by a server can be accessed by multiple processes simultaneously. In addition, the server supports accessing these databases from remote computers by TCP/IP. More details about client server mode vs. embedded database
|
|
[ODB1] Chapter 2 - A Quick Tour
, step by step. Both sample programs are contained in ObjectDB's samples directory. 2.1   ... ArrayList list; 18 try { 19 // Retrieve the list from the database by its name: 20 list = (ArrayList ... the database by its name "Hello World" using the getObjectById( ... ) method (line 20
|