About null


Storing objects problem

I want to save this object to database: @Entity public class Device { private String name; private String type; private String ipAddress; private Device parent; @Id private String ID; private String ID_HZMO; @ElementCollection private List<Device> children; }    ... ( ) ; this . parent = null ; }   public List<DeviceT> getChildren ...



Lock modes can be specified by means of passing a LockModeType argument to one of the javax.persistence.EntityManager methods that take locks (lock, find, or refresh) or to the Query.setLockMode() or TypedQuery.setLockMode() method.(Enum of JPA)


Exception in thread "ODB-StoreHandler-5094" java.lang.NullPointerException

Hi, ... What is happening when we hit the null pointer exception in a version prior to 2.7.0?  Are transactions ...


ODB should auto-restart if it detects it's necessary

Hi! I find very tricky the need to restart ObjectDB server after schema modifications in a distributed environment. Moreover, not doing it does sometimes trigger ugly errors, which mean application downtime. It might be very useful to have an additional feature (that could be enabled/disabled in objectdb.config) that each time ObjectDB detects a schema change that requires restart, it should automatically restart itself. This way we save a lot of headaches from our dev. ops. Currently we have to manually do: ... ) ; com.objectdb.o.InternalException: null at com.objectdb.o.BYR.s(BYR.java:113) at ...


can't get HashMap out of the database

I'm trying to persist an Entity containing a HashMap. It stores the data in the database OK, but the map is always empty when I get the entity out of the database again. I've reproduced this problem in a simple variation of the Guestbook tutorial: Guest class: ===================== ... be a bit closer to the actual code and I am now getting a null pointer exception trying to access the map in the nested object: ...


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 = currentTime.getTime(); Expression<Date> dateCapture = root.get(Counter_.dateCapture); Expression<Integer> samplingPeriod = root.get(Counter_.samplingPeriod); Expression<Integer> delayMinutes  = cb.prod(samplingPeriod,3); //minutes to be added ... ) RETURN DATE IS data_delay date: = NULL ; BEGIN SELECT DATE + ( ( PERIOD * DELAY_PERIOD ...


Deleting JPA Entity Objects

Explains how to use JPA to delete (remove) entity objects from the database.... example, such as when setting the address field to null or to another Address object. If orphanRemoval=true ...


Changes in detach behaviour?

Hello! Today i upgraded to 2.3.5_04. My program stopped working. After some debugging i found out that all fields of retrieved objects are on their default value till i first call a getter or detach them explicitly. Up to 2.3.4 they where initialized immediately. The problem in my case is that i have a Spring DAO. It does the following: I call for example getUserByName("blub). ... classes. If you run the project you'll see the output "null". If you use version 2.3.4 then the output is "username". I think lazy ...


500Mb ObjectDb database opening issue

Hi, I have observed that 500 Mb objectDb database opening time is very slow (~3 seconds) for following code m_EntityMgrFactory = Persistence.createEntityManagerFactory( "objectdb:" + aFilename ); m_EntityManager = m_EntityMgrFactory.createEntityManager(); Does exist any way to speed-up open time for big databases? Definitely, it's too long for 500 Mb database! ... ( ) ; m_EntityManager = null ;   m_EntityMgrFactory. close ( ) ; m_EntityMgrFactory = null ;   Files. deleteIfExists ( Paths. get ...


Schema-Update: Rename superclass and remove one subclass

Hello, we renamed a superclass and removed one of the subclass. If we then try to open the Database (with ObjectDB-Explorer) we get a "Failed to generate dynamic type ..."   Small Example: Generate Database ... java.lang.NullPointerException: null java.lang.NullPointerException at com.objectdb.o.ENH.g(ENH.java:401) at ...