About string


Help: After upgrading from 2.2.8_02 to 2.2.8_04, can't perform LIKE query

Hi,   During the upgrade from 2.2.8_02 (not sure if it was build 03/04 as I skipped 03) - my LIKE queries have stopped working. As an example output: ... a bit clearer. The field 'companyId' is a string.   Thanks ...


Failed to write the value of field using reflection (error 363) on LAZY fetch

Hi There I am using ObjectDB 2.6.3. I get the following Exception when I try to read my entities with a query where I have set to use LAZY initalization. It fails when it tries to set a 1:n member (e.g. a Modell has several Artikels) . When I remove the LAZY hint on the query execution it works. Any hints why this can happen? The Mapping of class Modell and its member: ... getEntityManager ( ) . createQuery ( String. format ( "SELECT e FROM %s e" ,classEntity. getSimpleName ...


ObjectDB CRUD Examples

Any place where I can find Netbeans examples for the basic create, read, update, delete methods using the EntityManager? i.e. public void create(Foo foo) {} public Foo read(Integer id) {} public List<Foo> read() {} public void update(Foo foo) {} public void delete(Foo foo) {} ... You may use a criteria query  instead of a string based query, but it will not save you lines of code. ...


JPA Query Structure (JPQL / Criteria)

Explains the structure of a JPQL query, which consists of 6 clauses: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY.... persistent fields, which are case sensitive. In addition, string literals are also case sensitive (e.g. "ORM" and "orm" are different ...


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: ...   public static void main ( String [ ] args ) { ...


Obtaining a JPA Database Connection

Shows how to use Java/JPA to connect to the ObjectDB Object Database.... file path (absolute or relative) is also accepted. Any string that ends with .odb or .objectdb is considered by ObjectDB to be ...


How to enhance the JPA/Spring/MVC to implement RESTfull for CURL client?

Here is my attempt to enhance the JPA/MVC/eclipse tutorial to implement a RESTful service. Why does this not work with this curl command? I get 404. Can someone help me correct this? Do I need to change my web.xml servlet mapping in web.xml? I've been experimenting with and nothing seems to work. Thanks Siegfried Here is my web.xml fragment: ... String username) {   return guestDao.getAllGuests().get(0); } ...


Cast exception?

Somehow I am unable to persist an entity class I wrote with manual @Id. I have a small Player class and I wish to store it with user ID as the primary key. So I declared the (only) primary key field as: @Id public int uid; This is how I'm persisting the instance: ... createEntityManagerFactory ( String paramString, Map paramMap ) /* */ { /* 73 ... 0 or none of them is able to create an emf with the given string... This is quite strange since we  are  able to ...


Primary key generation problem after changing entity package

Hi, I changed package name for some of my entities in database. I added info in <schema><package... /></schema> of my configuration file - and the changes have been succesfully made in database. Unfortunately, sequences have been probably lost for changed entity classes. After schema change I keep getting errors : Attempt to reuse an existing primary key value... My primary keys are annotated as shown below : ...   public static void main ( String [ ] args ) { ...



Defines a many-valued association with one-to-many multiplicity.(Annotation of JPA)