About MONTH

manual

Date and Time in JPQL and Criteria Queries

Shows how date and time can be used in JPQL queries.... supports 6 functions for extracting the YEAR , MONTH , DAY , HOUR , MINUTE and SECOND . For example: ... is evaluated to 2011 . MONTH({d '2011-12-31'}) is evaluated to 12 . ... See JavaDoc Reference Page... <Integer> month = cb. function function(name, type, args) ...

 
forum_thread

Group by date / time

Hi, I'm trying to create reporting query that will return entities grouped by year / mont / day. Each entity has it's own field that holds java.lang.Date. There is no function like YEAR(), MONTH() or DAY() in ODB. So, how to build queries similar to something like this: SELECT COUNT(id) FROM stats WHERE YEAR(record_date) = 2009 GROUP BY YEAR(record_date), MONTH(record_date) or maybe something like this: ... holds java.lang.Date. There is no function like YEAR(), MONTH() or DAY() in ODB. So, how to build queries similar to something like ... GROUP BY YEAR ( record_date ) , MONTH ( record_date ) or maybe something like this: ...

 
forum_thread

Grouping by date()

Hi, For some time now we can use date and time function in queries to extract part of date time (from documentation): YEAR({d '2011-12-31'}) is evaluated to 2011. MONTH({d '2011-12-31'}) is evaluated to 12. DAY({d '2011-12-31'}) is evaluated to 31. HOUR({t '23:59:00'}) is evaluated to 23. MINUTE({t '23:59:00'}) is evaluated to 59. SECOND({t '23:59:00'}) is evaluated to 0. ... YEAR({d '2011-12-31'}) is evaluated to 2011. MONTH({d '2011-12-31'}) is evaluated to 12. DAY({d ... few queries I was concatenating 'date' from year()-month()-day() calls, but this method is quite error prone and final queries are ...

 
forum_thread

TemporalType injection with Calendar using JPA

I have ObjectDB  JPA  comsummed by a RESTful web service deployed on Tomcat. I am using an embedded object as a primary key, which has time fields which I have annotated with TemporalType.TIMESTAMP When I use a java.util.Date as a field on this object there is no problem. However, if I use a java.util.Calendar it encounters an exception.   Calendar is what I need.  Is there something obvious here that I am failing to see?   #1 2011-05-30 17:15 I have ObjectDB  JPA  comsummed by a RESTful web service deployed on Tomcat. I am using an embe ...

 
forum_thread

java.lang.ClassCastException: CriteriaQueryImpl cannot be cast to java.util.List

Can someone please tell me what I'm doing wrong here? public List<Person> read(String name, ServletContext servletContext) {         EntityManagerFactory emf = (EntityManagerFactory) servletContext.getAttribute("emf");         EntityManager em = emf.createEntityManager();         List<Person> allPersons;         try { #1 2014-04-18 13:03 Please follow the posting instructions and use a separate thread for each subject. Your new question ...

 
issue

JPA Metamodel (JPA 2.0)

The JPA Metamodel API enables examining the classes, fields and properties of the persistent object model, similarly to the Java reflection API. The JPA Metamodel API has a major role in defining queries using the JPA Criteria API.... version 2.2, which is expected to be released later this month. ObjectDB Support ObjectDB - Fast Object ...

 
issue

JPA Query Criteria API (JPA 2.0)

The JPA Criteria API supports dynamic definition of JPQL queries using CriteriaBuilder as a factory. ObjectDB supports dynamic definition of JPQL queries as strings and expected to support also the new JPA 2 Criteria API in future versions.  ... version 2.2, which is expected to be released later this month. ObjectDB Support ObjectDB - Fast Object ...

 
forum_thread

Recovery file does not match db file

Just rebooted my production server, which had been running fine for months. When it came up, these errors started: ObjectDB 2.3.1_03] javax.persistence.PersistenceException Recovery file '/auctionologies/java/storage.odb$' does not match db file '/auctionologies/java/storage.odb' (error 145)  at com.objectdb.jpa.EMF.createEntityManager(EMF.java:176) at javax.persistence.EntityManagerFactory$createEntityManager.call(Unknown Source) Note: other than reboot the machine, I didn't do anything else. #1 2012-09-25 11:43 Just rebooted my production server, which had been running fine for months. When it came up, these errors sta ...

 
forum_thread

LEFT JOIN FETCH over empty embedded collection returns no results

First of all, thank you for promptly implementing JOIN FETCH over nested paths in response to my inquiry a few months ago. However, I have run into one problem: if an embedded collection is empty, but I attempt to LEFT JOIN FETCH all the members of a collection within a (non-existent) member of the first collection, the result of the overall query is an empty set. To use the example from my original post: @Embeddable class A { String val; };   #1 2013-05-23 11:06 First of all, thank you for promptly implementing JOIN FETCH over nested paths in response to my inquiry a few mo ...

 
forum_thread

Mysterious "Attempt to persist a reference to a non managed instance" error

I've been working with ObjectDB for the past several months, and it's behaved pretty much as expected. I made a few modifications to a working set of classes today, and it's started throwing exceptions at commit time. I've stripped it down to a  set of files that seem to be of trivial complexity, but it's still failing. It involves two entities, Index and Ostrich. The thing to note is that the Index structure is recursive through maps; but that's never caused any problem for me in the past. #1 2011-06-08 20:51 I've been working with ObjectDB for the past several months, and it's behaved pretty much as expected. I ...