Internal Website Search

51-100 of 200 results

Inserted entities with strings as keys and indices needs more and more ram memory in comparing to primitive integers as keys and indices

Hello, I have a problem with inserting of many entities. We use strings as primary key and indices ... primitive integers as keys and indices then the memory consumption for new entities is constant ... ? See both examples. btc_es BTC EmbeddedSystems Correction. The case with strings as primary key

Database Schema Evolution

name and either the same type or a convertible type, as explained below. A matching field ... from int to Date ) the fields are not considered as matching and the new field is initialized ... and enum values that are stored as numeric ordinal values (the default). From any type to Boolean or

JPA Persistence Unit

to instantiate an EntityManagerFactory in JPA ( as explained in the JPA Overview section) requires ... this manual can be replaced by equivalent XML in the mapping files ( as explained below). The jar-file elements ... properties. JPA 2 defines standard properties for specifying database url, username and password, as

ORDER BY clause (JPQL / Criteria API)

produces objects for examination and the WHERE clause selects which objects to collect as results ... Country objects ordered by currency as the primary sort key and by name as the secondary sort key ... in the ORDER BY clause. The following query is equivalent to the query above: SELECT c.currency AS

WHERE clause (JPQL / Criteria API)

objects to the SELECT clause for collecting as query results, the WHERE clause gets an opportunity to function as a filter. The boolean expression in the WHERE clause, which is also known as ... evaluates to TRUE are passed to the SELECT clause and then collected as query results. WHERE Predicate

JPA Query API

. Building Queries with createQuery As with most other operations in JPA, using queries starts with an EntityManager (represented by em in the following code snippets), which serves as a factory ... a TypedQuery instance the expected result type has to be passed as an additional argument, as

Locking in JPA

that manage the same Employee database object, which is referenced as e1 by em1 and as e2 by em2 (notice ... also releasing a lock explicitly while the transaction is active, as so:   em. lock (employee ... that can also be specified as arguments for the lock method to obtain special effects: OPTIMISTIC

Index Definition

explicitly in the members attribute, as shown above, the @Index or @Unique annotation can be attached ... firstName; String lastName; } Similarly, the @Uniques annotation can wrap multiple @Unique annotations. As ... that are stored as part of the entity. Therefore, indexes on multi part paths are only allowed

Auto Generated Values

also supports this annotation for non-key numeric persistent fields as well. Several different value generation strategies can be used as explained below. The Auto Strategy ObjectDB maintains a special global ... for entity objects with no primary key fields defined ( as explained in the previous section ). The same

JPA Query Structure (JPQL / Criteria)

rather than just field values from database tables, as with SQL. That makes JPQL more object oriented friendly and easier to use in Java. JPQL Query Structure As with SQL, a JPQL SELECT query also consists  ... elements such as names of entity classes and persistent fields, which are case sensitive. In addition

Entity Management Settings

(which serves as a first level cache). The valid values are "weak" , "soft " and "strong ". Modified ... entity objects as hollow, and loading their persistent content lazily, when they are accessed ... " ) specifies if serialization should be used as a fallback persisting method for instances

JPA Primary Key

key cannot be modified. It represents the entity object as long as it exists in the database. As ... . Instances of other persistable types are always stored as part of their containing entity objects ... automatically : } The @Id annotation marks a field as a primary key field. When a primary key field is defined

Database Management Settings

the background, a soon as new indexes are detected, in order to activate these new indexes. The  priority attribute specifies the speed of the index building background process as a number between ... . As soon as the background index activation is completed, ObjectDB can start using the new indexes

Storing JPA Entity Objects

or implicitly as a result of a cascade operation. Explicit Persist The following code stores ... (). commit (); The Employee instance is constructed as an ordinary Java object and its initial state ... of other persistable types can only be stored in the database embedded in containing entities ( as field

Schema Update

The configuration element supports renaming packages, classes and fields in ObjectDB databases as ... refactoring. Only these schema changes are specified in the configuration file. As explained in chapter 2 ... . The following element demonstrates the supported schema update abilities: The hierarchy, as demonstrated

Literals in JPQL and Criteria Queries

Literals in JPQL, as in Java, represent constant values. JPQL supports various types of literals ... ). JPQL literals should be used sparingly as queries that use parameters instead of literals ... rules, as explained in the Comparison Operators page. Boolean Literals Similarly to Java and SQL, JPQL

Chapter 6 - Configuration

) is derived from the location of the objectdb.jar file. It is defined as the path to the directory in ... the parent directory is considered to be the ObjectDB home directory ( $objectdb) . As a result ... "); // new $objectdb As with any other system property it can also be set as an argument to the JVM

Online Backup

), since an ObjectDB database is stored as an ordinary file in the file system.  ObjectDB ... in applications that provide round the clock service (24/7/365) such as most web applications ... argument is specified as a java.io.File instance and em represents a client-server connection

Paths and Types in JPQL and Criteria API

are assigned as arguments. Path expressions that navigate from one object to another. Instances of user ... , however, is valid even if the persistent field is declared as private (which is usually the case ... to iterate over all the Country objects in the database. For a country with no capital city, such as

Database Server

. In embedded mode, ObjectDB is integrated as a library and runs within the application process, which is much more efficient. As a result, embedded mode should be preferred when possible. For example ... Server tool is bundled in the objectdb.jar file. You can run it from the command line as follows: java

Database Transaction Replayer

of the database at the end of a specific transaction. The ID of that transaction is used as the name ... exist, ObjectDB automatically creates a backup file as a copy of the existing ObjectDB database file ... .objectdb.Replayer and the required argument is the path to the database file (e.g. my.odb as shown

Setting and Tuning of JPA Queries

operations, such as find . However, query execution is much more complex. Therefore, before a query ... , either at the  EntityManager level as a default for all the queries in that EntityManager or ... .query-language" - sets the query language, as one of "JPQL" (JPA query language), "JDOQL" (JDO query

Database Replication and Clustering

(but not in embedded mode) can function as a master database in a cluster.  Recording ... ;  The  url  attribute of the element defines a master database. As demonstrated ... , the master database can be accessed ordinarily  as follows: EntityManagerFactory emf

What is the Java Persistence API (JPA)?

) is that in JPA data is represented by classes and objects rather than by tables and records as in ... database programming. A JPA implementation (sometimes referred to as a JPA provider) is needed in order to interact with a relational database such as Oracle, DB2, SQL Server or MySQL. The popular JPA

DELETE Queries in JPA/JPQL

As  explained in chapter 2 , entity objects can be deleted from the database by ... a DELETE query. Therefore, it is a good practice to use a separate EntityManager for DELETE queries. As ... ;// an optional variable DELETE FROM Country AS c  // AS + an optional variable ObjectDB supports using

Obtaining a JPA Database Connection

:$objectdb/db/points.odb"); The createEntityManagerFactory static method expects a persistence unit name as ... does not close the database itself (that is the job of the factory as previously explained ... instance may preserve the EntityManager's resources (such as a database file pointer or a socket

Shared (L2) Entity Cache

that it manages. The persistence context serves as a first level cache. An attempt to retrieve ... that the cache is disabled for all the entity classes except classes that are specified as Cacheable ... is enabled for all the entity classes except classes that are specified as non Cacheable

Updating JPA Entity Objects

yet are also persisted. Automatic Change Tracking As shown above, an update is achieved by modifying a managed ... JDOHelper . makeDirty (employee, "projects"); // reported as dirty em. getTransaction (). commit (); As ... can be configured to detect array changes using snapshots as well as when enhanced entity classes are in use

General Settings and Logging

, such as query results that contain millions of objects. The element specifies temporary file settings ... can be used to represent the system default temporary path, as demonstrated above. Using RAM ... , which specifies when network sockets become obsolete as a result of inactivity. The value is the timeout

Is ObjectDB better than competing object databases?

of the Java Data Objects (JDO) API than competing object databases. By using a standard API such as JPA ... relational database by using an ORM JPA provider such as Hibernate, EclipseLink or Open JPA. Another advantage of using a popular API such as JPA is the availability of experienced developers

JPA Queries

Query API , as a cleaner alternative that enables building a dynamic query by using instances ... ; CriteriaQuery interface: As noted above, eventually every criteria query is managed by an ordinary ... is the factory of criteria queries as well as of criteria query elements. It can be obtained either by

What are the main benefits of using ObjectDB?

. Less (and more simple) code to write, debug and test, as well as a much easier learning curve leads ... fields can be stored by ObjectDB simply as part of the containing object. Relational databases lack ... multiple values (even for a simple data structure such as a collection of strings). In addition

Deleting JPA Entity Objects

method or implicitly as a result of a cascade operation. Explicit Remove In order to delete ... cascaded to the referenced Address instance, which is then automatically removed as well. Cascading ... the response to disconnecting a relationship. For example, such as when setting the address field

Criteria Query Selection and Results

and for representing query results as tuples. SELECT Clause Elements The content of the SELECT ... of Expression , any criteria expression  can be used as the SELECT clause content. Multiple ... ;for more details and examples. Query Results as Tuples JPA 2 introduces a new way to represent

Server User List

" (which represents the local machine), as shown above, restricts the user to the machine ... connecting from any IP address in the range of 192.18.0.0 to 192.18.194.255 , as well as from 127.0.0.1 ... ") it is interpreted by every concrete user definition as the real username of that user. This way, it is easy

Working with JPA Entity Objects

at it is that the persistence context also functions as a local cache for a given EntityManager . ObjectDB also manages a level 2 shared cache for the EntityManagerFactory as well as other caches as explained in

Detached Entity Objects

serialized object) is constructed as a detached entity object since is not associated with any ... instance, which is then automatically detached as well. Cascading may continue recursively when applicable ... to the referenced Address instance, which is then automatically merged as well. Cascading may continue recursively

JPA Named Queries

carefully to avoid collision (e.g. by using the unique entity name as a prefix). It makes sense to add ... to the same entity class requires wrapping them in a @NamedQueries annotation, as follows: @Entity ... still might fail if that named query is defined on a class that is still unknown to ObjectDB. As

Step 2: Entity Class and Persistence Unit

) and selecting  New Class . Enter  guest as the package name - use  exactly that case sensitive package name. Enter  Guest as the class name - use  exactly that case sensitive ... Folder and clicking Next ). Select the project src folder as a parent folder, enter META-INF as a new

Step 2: Entity Class and Persistence Unit

, enter src/main/java as Folder Name and click Finish . Open the [New Java Class] dialog box, e.g. by ... ; New Class . Enter  guest as the package name - use  exactly that case sensitive package name. Enter  Guest as the class name - use  exactly that case sensitive class name. Click

Step 7: Run the Spring Web App

the content of the index.jsp file (which serves as the default front page) with the following redirection to the  controller path: If Tomcat 6.0 is installed as a server in your Eclipse -  ... ), selecting  Run As Run on Server , selecting the Tomcat 6.0 server and clicking Finish

Step 4: Add a Controller Class

) and selecting  New Class . The package name should be  guest . Enter  GuestController as ... ); } } The GuestController class is defined as a Spring managed web controller using the @Controller annotation ... ModelAndView object defines a target JSP ( "guest.jsp" ) and passes the GuestDao component to the JSP as

Step 3: Define a Spring DAO Component

) that we will define in this step as a Spring MVC component: Open the [New Java Class] dialog box by right ... Java Class... . Enter  GuestDao as the class name - use  exactly that case sensitive class ... the controller, as shown in the next step. Prepares an  EntityManager automatically and injects

Step 4: Add a Controller Class

New Java Class ... Enter GuestController as the class name - use exactly that case sensitive class ... new ModelAndView("guest.jsp", "guestDao", guestDao); } } The GuestController class is defined as ... ( "guest.jsp" ) and passes the GuestDao component to the JSP as a request attribute (whose name

Step 3: Define a Spring DAO Component

) that we will define in this step as a Spring MVC component: Open the [New Java Class] dialog box by right ... . The package name should be  guest . Enter  GuestDao as the class name - use  exactly ... the controller, as shown in the next step. Prepares an  EntityManager automatically and injects

Step 2: Entity Class and Persistence Unit

Guest as the class name - use exactly that case sensitive class name. Enter guest as the package name ... with the following new content: com.objectdb.jpa.Provider Now ObjectDB should be used as a JPA provider

Step 5: Design a BIRT Report Chart

. In the [Select Chart Type] tab select Tube as the chart type and click Next . In the [Select Data] tab - enter row["y"] as the Y series and  row["x"] as the X series, (use Ctrl + Space in

Step 2: Entity Class and Persistence Unit

  Next ). Enter Guest as the class name - use exactly that case sensitive class name. Enter guest as the package name - use exactly that case sensitive package name. Click Next to create the new ... as a JPA provider with the specified database url. The next step is adding a Spring DAO Component class that will manage Guest entity objects.

[ODB1] Chapter 1 - About ObjectDB

database (for example, as a result of special customer needs or requests) can be done without modifying ... , the application uses ObjectDB as a class library, so no server process is needed in another JVM ... mode as well as the client-server operating mode. Embedded Database Edition This edition is limited

JDO Predefined ID Classes

a unique representation of a persistent object. The following classes serve as predefined ID classes ... but should not be used as the type of a primary key field in a persistence capable class. For example ... instances of MyClass ) can be represented uniquely by StringIdentity , as a combination of a class and a string value.