ObjectDB Database Search

1-50 of 200 results

Date and Time in JPQL and Criteria Queries

the results of predefined JPQL functions that return the current date and time. Current date and time ... when the query is executed: CURRENT _ DATE : Returns the current date as a java.sql. Date instance. CURRENT _TIME ... for building date and time expressions that represent the current date or time: // Create current date

JPA Criteria Query Date/Time Extraction

temporal components like year, month, or hour from date and time values. TemporalField # Base interface ├─ LocalDateField # Enum for Date fields ├─ LocalTimeField # Enum for Time fields └─ LocalDateTimeField # Enum for DateTime fields Date and Time components To extract a date or time component in

jakarta.persistence.TypedQuery.setParameter(Parameter,Date,TemporalType)

;  Parameter param ,    Date value ,    TemporalType temporalType ) Bind an instance of Date to a Parameter object. Parameters: temporalType - temporal type param - parameter ... should use the date /time types defined in java.time . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.TypedQuery.setParameter(String,Date,TemporalType)

;  String name ,    Date value ,    TemporalType temporalType ) Bind an instance of Date to a named parameter. Parameters: name - parameter name temporalType - temporal type ... is of incorrect type. Deprecated: Newly-written code should use the date /time types defined in java.time . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.TypedQuery.setParameter(int,Date,TemporalType)

;  int position ,    Date value ,    TemporalType temporalType ) Bind an instance of Date to a positional parameter. Parameters: position - position temporalType - temporal ... is of incorrect type. Deprecated: Newly-written code should use the date /time types defined in java.time . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.StoredProcedureQuery.setParameter(int,Date,TemporalType)

setParameter (    int position ,    Date value ,    TemporalType temporalType ) Bind an instance of java.util. Date to a positional parameter. Parameters: position ... if the value argument is of incorrect type. Deprecated: Newly-written code should use the date /time

jakarta.persistence.StoredProcedureQuery.setParameter(Parameter,Date,TemporalType)

setParameter (    Parameter param ,    Date value ,    TemporalType temporalType ) Bind an instance of Date to a Parameter object. Parameters: temporalType - temporal ... : Newly-written code should use the date /time types defined in java.time . Since: Jakarta Persistence (JPA) 1.0

jakarta.persistence.StoredProcedureQuery.setParameter(String,Date,TemporalType)

setParameter (    String name ,    Date value ,    TemporalType temporalType ) Bind an instance of java.util. Date to a named parameter. Parameters: name - parameter name ... if the value argument is of incorrect type. Deprecated: Newly-written code should use the date /time types

jakarta.persistence.TemporalType.DATE

Jakarta Persistence (JPA) Enum Constant in jakarta.persistence.TemporalType DATE Map as java.sql. Date Since: Jakarta Persistence (JPA) 1.0

Number of current connections

Is there any way to find out the number of current connections to the DB server? natmaclin Natalia Levine Currently not. You may subscribe to this feature request and update it according to your needs. support Support

Is there an API to get the current version of ObjectDB that's being used?

Is there an API to get the current version of ObjectDB that's being used? This would be very handy to have, because it is somewhat difficult to know what version of the ObjectDB you are currently using since the objectdb.jar filename remains the same for all versions (which is not a bad thing by

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

JPA Persistable Types

`, ` Date `, and math types. Multi-value types: Collections, maps, and arrays. Miscellaneous types: Enum ... .util. Date , java.util.Calendar , java.sql. Date , java.sql.Time , java.sql.Timestamp, java.time ... .OffsetDateTime , java.time.Instant. Date and time types are discussed in more detail in the next section. Date

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

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 ... ); How to do!! faber Faber Wouldn't it be more simple to subtract the delay from the current date and send

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 ... : We can currently not update the ODB version as this is a production system. Note also that doing

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

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

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

Auto Date for Creation and Update

Date gets  updated  once only and the change Date on each change? It seems for hibernate there Are annotations for it for Dates and also prepersist and preupdate. How about with objectdb ... these time/ date fields in a JPA lifecycle event methods . support Support Hi, Using the proposed solution I

com.objectdb.o.InternalException: java.lang.NoClassDefFoundError: java/sql/Date

.NoClassDefFoundError: java/sql/ Date java.lang.NoClassDefFoundError: java/sql/ Date at objectdb/com ... .JavaObjectDBApp.main(JavaObjectDBApp.java:14) Caused by: java.lang.ClassNotFoundException: java.sql. Date ... is ... module ObjectDBTest { requires objectdb; } This is perplexing because java.sql. Date comes with the JDK

Order in WHERE Clause affects behaviour on DATE/DATETIME columns

(TemporalType.TIMESTAMP) @Column(name = "myDate") Date myDate; } Now, when querying the db with: Query q ... value [%myQuery%] did not match expected type [java.util. Date (n/a)] because I haven't declared ... a difference. The date column seems to be converted to a String so it can be compared with the query

Using date in where clause

-2013" Here I have created Persons object as java.sql. Date attribute.   But in doing so I ... a query with date in where clause. n126961 Sandip The query is invalid because you compare a date (the creationDate field) with a string literal ("07-25-2013"). Replace the string with a date literal or a parameter . support Support

Query Parameters in JPA

instead of three is that JPA also provides three separate methods for setting Date parameters and three for setting Calendar parameters. Date and Calendar parameter values require special methods to specify whether they represent a date , a time, or a combination of date and time, as explained in

FROM clause (JPQL / Criteria API)

_LENGTH, BOTH, BY, CASE, CHAR_LENGTH, CHARACTER_LENGTH, CLASS, COALESCE, CONCAT, COUNT, CURRENT _ DATE , CURRENT _TIME, CURRENT _TIMESTAMP,DELETE, DESC, DISTINCT, ELSE, EMPTY, END, ENTRY, ESCAPE, EXISTS, FALSE ... only over the neighbors collection for the current c1 . In this case, propagating the WHERE constraint to the FROM

Literals in JPQL and Criteria Queries

) are case-sensitive, so 'abc' and 'ABC' are not equivalent. Date and time literals JPQL follows the SQL and JDBC syntax for date and time literals: Date : {d 'yyyy-mm-dd'} . For example: {d '2019-12-31 ... ); // String literals: Expression empty = cb. literal (""); Expression jpa = cb. literal ("JPA"); // Date

JPA Attributes Annotations

used to specify the storage format for enumerated types. Temporal mapping Map legacy date ... ): Specifies the database SQL type for a persistent field or property of type java.util. Date or java.util.Calendar . Specifies the database SQL type for a map key of type java.util. Date or java.util.Calendar

Database Schema Evolution

, it is automatically converted to an instance of the up-to- date entity class. This conversion ... to the new type (for example, a change from int to Date ), the fields are not considered matching ... () if necessary). From String to numeric types, including enum types (when applicable). From any date /time type

Retrieving JPA Entities

the field from cascaded retrieval. (ObjectDB currently does not distinguish between these two annotations ... or @ManyToMany annotation enables cascaded retrieval for the field. (ObjectDB currently does not ... that the application is working with the most up-to- date version of an entity, in case it was changed

Index Definition

( name ="u2") Date indexedField5; // unique } The @Unique annotation defines a unique index ... .util. Date , java.sql. Date , java.sql.Time , java.sql.Timestamp Any enum type A reference

jakarta.persistence.criteria.CriteriaBuilder

(JPA) 1.0 Expression currentDate () Create expression to return current date . Returns: expression for current date . Since: Jakarta Persistence (JPA) 1.0 Expression currentTime () Create expression ... (JPA) 1.0 Expression localDate () Create expression to return current local date . Returns: expression

JPA Query Expressions (JPQL / Criteria)

on the following pages: Literals and dates ( literal , nullLiteral , currentDate , …) Paths, navigation ... ) String expressions ( like , length , locate , lower , upper , concat , substring , …) Date and time

jakarta.persistence.TypedQuery

properties and hints. Since: Jakarta Persistence (JPA) 2.0 LockModeType getLockMode () Get the current ... to a parameter of the query. Deprecated: Newly-written code should use the date /time types defined in java.time . Since: Jakarta Persistence (JPA) 1.0 TypedQuery setParameter ( Parameter param , Date value

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

Schema Update

, the instructions should usually be on the client side, where the up-to- date classes are located. The following

JPA Metamodel Types

, Strings, or Dates ) that do not contain persistent attributes of their own. An enumeration

JPA Queries

predicates for the WHERE clause, mathematical operations, and conditional logic. Helper interfaces for manipulating temporal expressions and date /time components.

Privacy Policy

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

JPA Class Enhancer

.Enhancer If objectdb.jar is not in the current directory, a path to the file must be specified ... compared to the other techniques described above. First, it currently works only on Sun JDK 6 or

Bug when using SIZE in combination with date lower parameter

there seems to be a bug if I use the lower date select: SELECT j.jobId, SIZE(j.tags) FROM ParserJob j WHERE j.dateCreated = : date I get the correct result (1 Tag). You find a test case at  . Please start ... cannot be both before and after the date parameter. support Support Hello, to archieve the results the date

com.objectdb.o.InternalException: java.lang.NoClassDefFoundError: java/sql/Date

: java.lang.NoClassDefFoundError: java/sql/ Date java.lang.NoClassDefFoundError: java/sql/ Date ... .main(Main.java:19) Caused by: java.lang.ClassNotFoundException: java.sql. Date at java.base/jdk ... idea why java.sql. Date is not found in the classpath? Which Java version are you using? Do you use

jakarta.persistence.EntityManager

that is currently associated with a persistence context. A detached entity is an instance with a persistent ... to the current persistence context. Parameters: entity - entity instance Returns: boolean value indicating ... if invoked on an entity manager which has not been joined to the current transaction and a lock mode

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