About property

forum_thread

Does ObjectDB support @Parent for @Embeddable reference to parent?

AFAIK JPA does not directly support an @Embeddable referencing the parent in which it is @Embedded. But Hibernate has a special @Parent for it (see Entity extensions 2.4.3.4.@Parent). @Entity public class Person { @Embeddable public Address address; ... } @Embeddable public class Address { @Parent public Person owner; ... } Is there a safe and recommended way of achieving this in ObjectDB ? ... @ Access ( AccessType . PROPERTY ) @ Embedded private Profile profile ; ... well, but get methods should be annotated when using property access, rather than the annotated fields, as shown on the first post. ...

 
forum_thread

Entity listener - event instead of object

Hi, Currently I'm playing with entity listener to implement auditing with difference between values in updated entity. There is a problem however with accessing "old" version of object stored in database. I can't find the nice way to use EntityManager in EntityListener. Because of that, I can't store separate entity for given event. Right now I'm using BaseEntity which contains ... entity from session so that we can extract existing property values Object existingEntity = session. get ... ) ;   // cycle through property names, extract corresponding property values and insert new entry in ...

 
forum_thread

Setting temp directory location in ObjectDB

HI, I am using ObjectDB and would to change the temp directory location wihtout using objectDB.conf file. I am using JDO and setting the persistenceManager as follow properties.setProperty("javax.jdo.PersistenceManagerFactoryClass","com.objectdb.jdo.PMF"); properties.setProperty("javax.jdo.option.ConnectionURL", fileName.odb); pmf = JDOHelper.getPersistenceManagerFactory(properties), JDOHelper.class.getClassLoader()); ... java class  e.g setting through system property or ..... I m using fileName.odb file to store the objects and ... by setting the  com.objectdb.recovery.path system property. ObjectDB Support ObjectDB - Fast Object ...

 
forum_thread

Duplicate Entity class names causes Exception in Query

I have two Entities which have the same class name but reside in different packages, only one of them is mentioned in the persistence.xml. I a NamedQuery I use the unqualified class name of one of these entities. If I execute that query I get an exception;   ... > <properties > <property name = "javax.persistence.jdbc.url" value = ... /> <property name = "javax.persistence.jdbc.user" value = "admin" /> <property name = "javax.persistence.jdbc.password" value = "admin" ...

 
forum_thread

Error 363 - Failed to read value of inverse relationship

I've got two objects: @Entity public class EEvent { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @ManyToOne(optional=false) private ETown town; public ETown getTown() { return town; } public void setTown(ETown town) { this.town = town; } } And: ... Failed to write the value of field property edu.um.fcsit.jpa.entity.Guest.phoneList using enhanced method (error ... Failed to write the value of field property edu.um.fcsit.jpa.entity.Guest.phoneList using enhanced method ...

 
tutorial

Step 6: Set the Spring XML

Explains how to set XML in a NetBeans Spring MVC JPA web application project.... > <property name = "loadTimeWeaver" > <bean class ... /> </property > </bean >   <!-- Add Transaction ... > <property name = "entityManagerFactory" ref = "emf" /> ...

 
tutorial

Step 6: Set the Spring XML

Explains how to set XML in an Eclipse Spring MVC JPA web application project.... > <property name = "loadTimeWeaver" > <bean class ... /> </property > </bean >   <!-- Add Transaction ... > <property name = "entityManagerFactory" ref = "emf" /> ...

 
api-jpa

javax.persistence.MapKeyColumn

Specifies the mapping for the key column of a map whose map key is a basic type.(Annotation of JPA)

 
forum_thread

Request clarification of changes to accessor enhancement policy (non-getter prefix instead of getter suffix) AND annotations

In response to the forum posting http://www.objectdb.com/database/forum/994 changes were made to the way enhancement treats getters and setters (property accessors), namely there are no longer enhanced additional getters/setters, because the additional methods now use (since about version 2-6-5) this pattern: __odbHidden_[accessor_name] Instead of this pattern with a suffix (preserving the method as a setter or getter), prior to version 2-6-5: ... made to the way enhancement treats getters and setters (property accessors), namely there are no longer enhanced additional ... - Renamed internal Enhancer hidden methods to non property method names. This change is a huge GOTCHA, and should be ... moved from the Enhancer generated hidden methods to the property get/set methods. If it does happen again then please report." ...

 
forum_thread

Spring Transactions (@Transactional) within ObjectDB

Hi, We are using OBD with Spring and transactions are managed by Spring. Our spring service interfaces take list of objects and persist them and the interface service is marked as @Transactional. We iterate through the list apply business validations and persist them one by one in a loop. ( Using Spring Data) We have noticed that in a loop 1st object is persisted and then we if lookup the same object we don't get it back on lookup. ... think I need help here -- I thin the entity Manger property for FlushModeType is need to be specified in persistence.xml in my ... IN case of hibernate I can use something like <property name="org.hibernate.FlushMode" value="auto" /> That's ...