Internal Website Search

1-50 of 200 results

Date and Time in JPQL and Criteria Queries

Date and time expressions may appear in JPQL queries: as date and time literals - e.g. {d '2011-12-31'} , {t '23:59:59'} . as parameters - when date and time values are assigned as arguments. as  path expressions - in navigation to persistent date and time fields. as results of predefined

JPA Persistable Types

, Date and Math types. Multi value types - Collections, Maps and Arrays. Miscellaneous types: Enum ... . java.lang.String . java.util. Date , java.util.Calendar , java.sql. Date , java.sql.Time , java.sql.Timestamp . Date and time types are discussed in more detail in the next paragraph. Date and Time

Query Parameters in JPA

rather than just three is that JPA additionally provides three separate methods for setting Date , parameters as well as three separate methods for setting Calendar parameters. Date and Calendar parameter values require special methods in order to specify what they represent, such as a pure date , a pure time

Internal exception when updating date filed (TemporalType.DATE)

Hello! ObjectDB version 2.5.3_02. I get internal exception when commiting update Date field (javax.persistence.TemporalType. DATE ). [ObjectDB 2.5.3_02] javax.persistence.RollbackException Failed ... ; List dates = new ArrayList ();         calendar.set(1980, 2, 1

Query filter comparing Dates

Hi, I am using an indexed java.util. Date field in my Entity and I came across some weird behaviour in query filters comparing this Date field. Could You please clarify why are there zero-size result ... am comparing 2 dates which should be equal because they are showing exactly same inner millisecond count

ObjectDB Object Database Features

using XML and annotations. Zero administration. Documentation Compressive, up to date , searchable ... .String Date types : java.util. Date , java.sql. Date , java.sql.Time and java.sql.Timestamp. Math types ... (Boolean, Byte, Short, Character, Integer, Long, Float and Double). java.lang.String Dates : java

Date field Index is corrupted due to time change

the bug, which affects indexes on pure Date fields (i.e. date with no time). ObjectDB converts pure date values between local time and UTC more than once during transaction commit, and on clock ... that records are being added to the DB at the time of the time change. However, what values in the date

How to add minutes to a Date with JPA2

Hi,  I have to sum to a date of minutes, and check the date obtained is greater than the current date . My idea is as follows: Calendar currentTime = Calendar.getInstance(); Date currenteDate ... ); //minutes to be added I must now sum to the dateCapture the delayMinute and verify that the current date

java.sql.Date equals comparison not working with CriteriaAPI

Hello, Using ODB 2.4.5 and the Criteria API, doing a simple equals comparison with java.sql. Date ... = ...; Root root = ...; java.sql. Date myDate = ...; Predicate predicate = builder.equal(root ... greaterEqual or lessEqual with Criteria API will yield in correct results except if the given date

Grouping by date()

Hi, For some time now we can use date and time function in queries to extract part of date time ... have to group by date (). For few queries I was concatenating ' date ' from year()-month()-day() calls ... to add one more method to above list - date () - that will return only date from java.util. Date

Problem with 'where' and date()

Hi, Today I was playing with some date -range queries in explorer and found a small problem. When you try to use queries like this: SELECT o from TestObject o where o. date :someDate where o. date is java.util. Date , 'where' doesn't work as it should. Results are not filtered by date

GWT RPC is throwing serialization exception when I have object db date value

Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'objectdb.java.util. Date ... ;   kpanda ganesh gothai The objectdb.java.util. Date  class is a subclass of java.util. Date ... this is not sufficient for GWT because Date is a special data type. You may have a similar

Wrong data stored in date only fileds

Hi, we have an object with the following fields:   private Date startDateTime; // Time stamp: start of recording in local time zone private Date startDate; // Date : date part of startDateTime private Date startTime; // Time: time part of startDateTime @Basic(optional = false) @Temporal

Dates

Question on dates . SQL doesn't seem to store timezone with dates (oddly). So, any best practises with ODB? 1. use java.util. Date 2. Milliseconds since January 1, 1970, 00:00:00 GMT 3. other? dmoshal David Moshal When a Date instance is stored in an ObjectDB database it is converted automatically

Entity with java.util.Date column gives ClassCastException in BIRT

a simple JPQL query to select the fields. Entity looks like this: package entity; import java.util. Date ... ; @Temporal(value = TemporalType. DATE )     private Date birthdate;     /**   ... ;    */     public Date getBirthdate() {      

Group by date / time

. Each entity has it's own field that holds java.lang. Date . There is no function like YEAR(), MONTH ... 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

How to store and compare Date up to sec.

How to store and compare date up to sec? By default it stores the dates like "23 May, 2020 10:25:23:112 AM" means date and timestamp including milisec but  I want to store till sec("23 May, 2020 10:25:23 AM") like MySql and other db. They stores the date up to sec. Manoj Manoj

Literals in JPQL and Criteria Queries

' and 'ABC' are not equivalent. Date and Time Literals JPQL follows the syntax of SQL and JDBC for date literals: Date - {d 'yyyy-mm-dd'} - for example: {d '2019-12-31'} Time - {t 'hh:mm:ss ... = cb. literal (""); Expression jpa = cb. literal ("JPA"); // Date and Time literals: Expression today

javax.persistence.TemporalType.DATE

JPA Enum Constant in javax.persistence.TemporalType DATE Map as java.sql. Date Since: JPA 1.0

Database Schema Evolution

of an old schema is loaded into memory it is automatically converted into an instance of the up to date ... from int to Date ) the fields are not considered as matching and the new field is initialized ... (when applicable). From any date type to any date type. From any collection or array type to any

Index Definition

; // unique @Unique ( name ="u2") Date indexedField5; // unique } @Unique represents a unique index ... .BigInteger , java.math.BigDecimal. java.lang.String. java.util. Date , java.sql. Date , java.sql.Time

JPA Primary Key

.lang.String. java.util. Date , java.sql. Date , java.sql.Time , java.sql.Timestamp. Any enum type ... EventId id; : } @Embeddable Class EventId { int sensorId; Date time; } Because entity objects

Comparison in JPQL and Criteria API

, comparing the content rather than the identity. Date values can be compared by using any comparison operator. Equality operators (=, , == , != ) on date values in queries follow the logic of equals

Paths and Types in JPQL and Criteria API

, string, date ). Simple type values are more useful in queries. They have special operators ... types (number, boolean, string, date ). For a path expression to be valid the user defined persistable

GROUP BY and HAVING clauses

of comparable values (numeric, strings, dates ). MAX - returns the maximum of comparable values (numeric, strings, dates ). The following query counts for every letter the number of countries with names

Apache License, Version 2.0, January 2004

to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution

FROM clause (JPQL / Criteria API)

, BOTH, BY, CASE, CHAR_LENGTH, CHARACTER_LENGTH, CLASS, COALESCE, CONCAT, COUNT, CURRENT_ DATE , CURRENT

Schema Update

the instructions should usually be located on the client side where the up to date classes are located

JPA Annotations for Fields

The way a field of a persistable class is managed by JPA can be set by the following annotations: Additional annotations (and enum) are designated for enum fields: Other additional annotations (and enum) are designated for date and calendar fields: Chapter 2 of the ObjectDB manual explains how to use all the above annotations.

JPA Query Expressions (JPQL / Criteria)

expressions are provided as follows: Literals and Dates  ( literal , nullLiteral , currentDate

Retrieving JPA Entity Objects

to ensure that the application deals with the most up to date version of an entity object, just in

Privacy Policy

device identifiers, browser type, browser version, the time and date of Your visit, the pages

Eclipse Public License - v 1.0

of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate

Online Backup

that reflects the current date and time (e.g.  201912312359 ) is created under the backup root

JPA Criteria API Queries

expressions are provided in the following page sections: Literals and Dates  ( literal

ORDER BY clause (JPQL / Criteria API)

whose type is comparable (i.e. numbers, strings and date values) and is derived from the SELECT

General Settings and Logging

(where represents the date ). A new log file is also generated when the log file exceeds the maximum size

Database Explorer

reflect the up to date data in the database. In this case you can refresh the cache and the viewer

[ODB1] Chapter 7 - JDOQL Queries

), but use the equals( ... ) method for system types ( String , Date , ArrayList , ...). String instances can be compared using all six comparison operators. Date instances can be compared using ... : Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.set(2000, 0, 1); Date date

Step 2: Entity Class and Persistence Unit

.Serializable; import java.sql. Date ; import javax.persistence.Entity; import javax.persistence ... String name; private Date signingDate; // Constructors: public Guest() { } public Guest(String name) { this.name = name; this.signingDate = new Date (System.currentTimeMillis()); } // String Representation

Step 2: Entity Class and Persistence Unit

.Serializable; import java.sql. Date ; import javax.persistence.Entity; import javax.persistence.GeneratedValue ... name; private Date signingDate; // Constructors: public Guest() { } public Guest(String name) { this.name = name; this.signingDate = new Date (System.currentTimeMillis()); } // String Representation

Step 2: Entity Class and Persistence Unit

java.io.Serializable; import java.sql. Date ; import javax.persistence.Entity; import javax.persistence ... ; private String name; private Date signingDate; // Constructors: public Guest() { } public Guest(String name) { this.name = name; this.signingDate = new Date (System.currentTimeMillis()); } // String

Step 2: Entity Class and Persistence Unit

.Serializable; import java.sql. Date ; import javax.persistence.Entity; import javax.persistence ... name; private Date signingDate; // Constructors: public Guest() { } public Guest(String name) { this.name = name; this.signingDate = new Date (System.currentTimeMillis()); } // String Representation

Step 2: Define a JPA Entity Class

.Serializable; import java.sql. Date ; import javax.persistence.Entity; import javax.persistence ... String name; private Date signingDate; // Constructors: public Guest() { } public Guest(String name) { this.name = name; this.signingDate = new Date (System.currentTimeMillis()); } // String Representation

Step 2: Define a JPA Entity Class

code: package guest; import java.io.Serializable; import java.sql. Date ; import javax.persistence.Entity ... @GeneratedValue Long id; private String name; private Date signingDate; // Constructors: public Guest() { } public Guest(String name) { this.name = name; this.signingDate = new Date

[ODB1] Chapter 4 - JDO Metadata

and Integer ), types defined in java.math (e.g. BigInteger ), and java.util. Date . Collections, arrays ... . Wrapper objects, strings, dates , collections and arrays are embedded by default. To use them as non ... default, so a collection of strings or dates is fully embedded by default. Specifying embedded-element

javax.jdo.annotations.VersionStrategy.DATE_TIME

JDO Enum Constant in javax.jdo.annotations.VersionStrategy DATE _TIME Since: JDO 2.1

[ODB1] Chapter 3 - Persistent Classes

.util : Date , Locale , HashSet , TreeSet , ArrayList , LinkedList , Vector , HashMap , TreeMap ... it is automatically converted into an instance of the new up-to- date persistent class. The conversion ... automatically to the new type. If casting is illegal (for example from int to Date ) the field

[ODB1] Chapter 6 - Persistent Objects

in memory is up to date . If true is specified and the object in database is different, the cached ... and section 4.4 ). Therefore, by default, String and Date fields, as well as collection fields (such as

[ODB1] Chapter 2 - A Quick Tour

. Predefined Java types like ArrayList , String and Date can be stored in the database only as fields