ObjectDB Database Search

1-50 of 200 results

Literals in JPQL and Criteria Queries

, including NULL , boolean literals ( TRUE and FALSE ), numeric literals (for example , 100 ), string literals (for example , 'abc' ), enum literals (for example , mypackage.MyEnum.MY_VALUE ), and entity type literals (for example , Country ). Use JPQL literals sparingly. Queries that use parameters

SELECT clause (JPQL / Criteria API)

The ability to retrieve managed entities is a key advantage of JPQL. For example , the following ... . Projection of path expressions JPQL queries can also return results that are not entities. For example ... the FROM clause. Nested path expressions are also supported. For example , the following query retrieves

FROM clause (JPQL / Criteria API)

(you can use type expression to exclude descendant classes from iteration). For example , in ... (for example , Country with no package name). The default name can be overridden by specifying another name ... . For example , the following query returns all pairs of countries that share a common border: SELECT c1

Strings in JPQL and Criteria Queries

String values can appear in JPQL queries in several forms: As string literals , for example , 'abc ... a path expression), and the right operand is the pattern (usually a parameter or literal). For example ... in an ESCAPE clause. For example : '100%' LIKE '%\%' ESCAPE '\' is evaluated to TRUE . '100' LIKE

Retrieving JPA Entities

and its primary key. Given an EntityManager instance em , the following example retrieves an Employee ... method is useful when you need a reference to an entity but not its data, for example , to set ... object, unless the referenced object is already managed by the EntityManager . In the preceding example

JPA Persistable Types

) of their own. This leads to some limitations (for example , their instances cannot be shared by different ... and times: java.sql.Date - represents the date only ( for example , `2019-12-31 `). java.sql.Time - represents the time only ( for example , `23:59:59 `). java.sql.Timestamp - represents both date and time

Numbers in JPQL and Criteria Queries

numeric promotion principles. For example , the result of a binary arithmetic operation on an int value ... of a numeric argument. The result is always a positive number or zero. For example : ABS(-5) evaluates to 5 ... . For example : MOD(11, 3) evaluates to 2 . MOD(8, 4) evaluates to 0 . The MOD function takes two integer

Database Explorer

a hash symbol ( # ), for example , Point#1 . Specify a collection as a comma-separated list ... for the selected query. This is useful, for example , for checking which indexes are used. The Reset ... and primary key, separated by a hash symbol ( # ), for example , Point#1 . Use Edit Set Reference Set to New

Schema Update

the preceding example , is strict: A element must be a direct child of the element. A element ... within that package. The elements in the example rename the com. example .old1 and com. example .old2 packages. The com. example .old3 package is not renamed, but rename operations are specified for some of its classes

Database Server

, which is more efficient. As a result, you should use embedded mode when possible. For example , if an ObjectDB ... . For example , you can increase the maximum JVM heap size and improve performance by using the HotSpot JVM ... system's documentation for instructions on how to: Run the server in the background (for example , by

JPA Class Enhancer

(for example , the get and set methods). If you follow this practice, only user-defined persistable ... the syntax of import statements (for example , test.X for a single class or test.pc.* for a package ... with objectdb.jar as a Java agent. For example , if objectdb.jar is in c:\objectdb\bin , the JVM

JPA Metamodel API

() method or the EntityManager 's getMetamodel() method. Both methods are equivalent. For example , given ... yet known to ObjectDB (for example , types that are not listed in the persistence unit and have not ... managed fields and properties , also known as attributes. For example : // Get all the attributes

BIRT/ODA ObjectDB Driver

. Enter a data source name (for example , ObjectDB Points ) and click Next . Specify an ObjectDB connection URL. This can be an embedded URL (for example , c:\points.odb ) or a client-server URL (for example , objectdb://localhost/points.odb;user=admin;password=admin ). Click Finish to create the ObjectDB

Paths and Types in JPQL and Criteria API

because they have special operators and functions (for example , for strings and numbers ). They can also be compared ... fields to other objects and values. For example , in the expression c.capital , c represents a Country ... can be extended by reusing the dot ( . ) operator. For example , c.capital.name is a nested path expression

ORDER BY clause (JPQL / Criteria API)

directly from expressions in the SELECT clause. For example , the following query is invalid ... expression whose type is comparable (for example , numbers, strings, and date values) and is derived from ... the results into groups. The ORDER BY clause then sorts these groups. For example : SELECT c

JPA Entity Fields

-final entity field is persistent by default unless specified otherwise (for example , by using ... , such as Hibernate, or for changing default field settings. For example : @Entity public class ... ( mappedBy ="department") Set employees; } The mappedBy element in the preceding example specifies

Collections in JPQL and Criteria Queries

] EMPTY The IS [NOT] EMPTY operator checks whether a specified collection is empty. For example : c ... (collection) function returns the number of elements in a specified collection. For example : SIZE(c.languages ... . For example : 'English' MEMBER OF c.languages evaluates to TRUE if the languages collection contains

Privacy Policy

the use of the Service or from the Service infrastructure itself (for example , the duration of a page ... gifs) that permit the Company, for example , to count users who have visited those pages or opened an email and for other related website statistics (for example , recording the popularity of a certain

Database Doctor

for several reasons: Hardware failure (for example , a physical hard drive failure or RAM error). Software failure (for example , a bug in the operating system, Java, or ObjectDB). Copying a database file ... . Modifying the database file externally instead of through ObjectDB (for example , with malicious software

JPA Connections and Transactions

during their lifetime. For example , in a web application, it is common to establish a separate database ... for a specific database. It manages resources efficiently (for example , a pool of sockets ... ), you must specify an absolute or relative path to a local database file (for example , "my.odb" ). The objectdb

Running JPA Queries

like any other Java collection. For example , you can iterate over a result collection ... result object. However, you must then extract the object from the result collection, for example , by ... . For example , the following query is expected to return a single Country object: Query query = em

UPDATE SET Queries in JPA/JPQL

because bypassing the EntityManager can disrupt its synchronization with the database. For example ... the database, including instances of its subclasses. For example , the following three equivalent ... if one is defined. You can update multiple fields by providing a comma-separated list of expressions. For example

Online Backup

date and time (for example , 201912312359 ). The backup database file is then created in this new subdirectory with the same name as the original database file. For example , backing up a test.odb database ... is relative to the ObjectDB home directory on the server. For example , in client-server mode, the code

GROUP BY and HAVING clauses

. For example , the preceding query, which does not use aggregates, is equivalent to the following query ... , such as the expressions used for grouping (for example , c.currency ), and aggregate expressions ... that result from the FROM and WHERE clauses are treated as a single group. For example , the following query

Setting and Tuning of JPA Queries

efficient result paging. For example , if each page displays pageSize results and pageId represents ... to all result objects that the query retrieves. For example , the following code sets a pessimistic WRITE ... . For example , setting a query hint on an EntityManager affects all queries that are created by

Storing JPA Entities

. Referenced entities If, however, the Address class in the previous example is an entity class ... ) private Address address; : } In the preceding example , the Employee entity class contains ... a separate persist call. Cascading can continue recursively, for example , to entities that the Address

Database Replication and Clustering

the master database. As shown in the example , you must specify a full URL, including the user ... server. Connecting to the database cluster The configuration example shows a master database managed ... this example . However, if the first URL becomes unavailable, the connection automatically and temporarily

Detached JPA Entities

have limited functionality: Many JPA methods, for example , lock , do not accept detached objects. Retrieval by ... = CascadeType . DETACH ) private Address address; : } In the example above, the Employee entity has an address ... Address address; : } In the example above, the Employee entity has an address field that references

JPA Query Structure (JPQL / Criteria)

operates on Java classes and objects. For example , a JPQL query can retrieve entities, unlike SQL ... . For example , JPQL keywords can be uppercase (e.g., SELECT ) or lowercase (e.g., select ... : SELECT c FROM Country AS c This example demonstrates a minimal JPQL query because the SELECT

JPA Named Queries

, you should choose names carefully to avoid collisions, for example , by using the unique entity name as a prefix. For example , you can add the preceding @NamedQuery to the Country entity class: @Entity ... their named queries by using the JPA 2 Metamodel interface. For example : em. getMetamodel (). managedType

DELETE Queries in JPA/JPQL

. For example , the EntityManager might not be aware that a DELETE query has removed an entity ... . For example , the following three equivalent queries delete all Country instances: DELETE FROM ... . A WHERE clause is supported and is essential for removing specific entities. For example

WHERE clause (JPQL / Criteria API)

this case, the WHERE clause filters these tuples before passing them to the SELECT clause. For example ... it as the WHERE clause predicate, overriding any previously set predicate. For example , the following ... arguments and combines them using a logical AND , overriding any previously set predicate: For example

Query Parameters in JPA

is inferred from the context. In the preceding example , comparing :name to a field of type String ... the application to JPQL injection attacks. For example , suppose the name parameter is received as user input ... the Date and Time (Temporal) Types section. For example , the following invocation passes a Date object

Database Schema Evolution

to the new type (for example , a change from int to Date ), the fields are not considered matching ... , as long as the elements are convertible (for example , from int[] to ArrayList ). From any object ... other map type, as long as the keys and values are convertible (for example , from HashMap to TreeMap ). Any

What's next?

below to create and run the example program from this chapter: These tutorials explain how to run the example program. You can start your own ObjectDB/JPA projects by modifying this example program

Deleting JPA Entities

) private Address address; : } In the preceding example , the Employee entity has an address field ... is how they handle a disconnected relationship, for example , when you set the address field to null or ... . For example : @Entity class Employee { : @OneToMany ( orphanRemoval =true) private List addresses; : } In

JPA Shared (L2) Entity Cache

except those explicitly marked as @Cacheable . For example : @Cacheable // or @Cacheable(true) @Entity public class ... classes except those explicitly marked as not cacheable . For example : @Cacheable (false) @Entity ... ); You can also override the setting for a specific retrieval operation. For example : em. find

Comparison in JPQL and Criteria API

standard Java logic. For example , null == null evaluates to true . All other operators ... between any two values that belong to the same group listed above. For example , a double ... these examples , :min and :max are query parameters : x BETWEEN :min AND :max x = :min AND x ) Predicate gt1 = cb

JPA Persistence Unit

the environment rather than static files. The following example demonstrates how to configure a persistence ... -unit XML element. The required name attribute ( my-pu in the example ) identifies the persistence ... queries are available only after their containing classes become known to ObjectDB--for example , when the first instance of a class is stored in the database.

JPA Optimistic and Pessimistic Locking

lock or a PESSIMISTIC_READ lock on that database object. For example , consider the following code ... a single atomic operation. For example , the find method has a form that accepts a lock mode: Employee ... includes pessimistic locking, a timeout can be specified as a property. For example : Map properties

JPA Primary Key

must be one of the supported types listed above. For example , the primary key of the following Project ... ) of a managed entity. For example : PersistenceUnitUtil util = emf. getPersistenceUnitUtil (); Object ... result sets. For example , consider a real-time system that detects events from various sensors

Database Transaction Replayer

file, such as my.odb in the example above. ObjectDB automatically locates the corresponding backup ... . You can also run the Replayer up to a specified transaction. For example : $ java -cp objectdb.jar com

Date and Time in JPQL and Criteria Queries

Date and time expressions can appear in JPQL queries in the following ways: As date and time literals --for example , {d '2011-12-31'} and {t '23:59:59'} . As parameters --when date and time values ... , MONTH , DAY , HOUR , MINUTE , and SECOND parts from a date or time value. For example : YEAR({d '2011

Is ObjectDB better than competing object databases?

is also unique in supporting features that are usually available only in relational databases. For example ... that during development you may find that an essential feature is missing. For example , some competing products

Defining a JPA Entity Class

String toString() { return String.format("(%d, %d)", this.x, this.y); } } As the example shows, an entity ... field that is not declared as static or transient is a persistent field. For example , the persistent

Eclipse Public License - v 1.0

responsibility to secure any other intellectual property rights needed, if any. For example ... . For example , a Contributor might include the Program in a commercial product offering, Product X

JPA Criteria API Queries

. For example , building a dynamic query based on a form with many optional fields is cleaner ... getCriteriaBuilder method or the EntityManager 's getCriteriaBuilder method. In the example

Server User List

to connect to the server only from the specified IP addresses. For example , "127.0.0.1" (the local computer ... addresses in a comma-separated list and use a hyphen (-) to specify a range. For example , a value

Chapter 1 - Quick Tour

This chapter demonstrates basic ObjectDB and JPA concepts by introducing a simple example program. After reading this chapter, you will be able to write basic programs that create, open, and close ... . The example program in this chapter manages a simple database that contains points in the plane. Each point

jakarta.persistence.Convert

of the attribute of the key or value type that is converted. Example 1: Convert a basic attribute ... ; ... } Example 2: Auto-apply conversion of a basic attribute @Converter(autoApply = true) public class ... id; ... // EmployeeDateConverter is applied automatically EmployeeDate startDate; } Example 3