Class JPAObjectStoreDelegate

  • All Implemented Interfaces:
    JPAObjectStore, io.vlingo.symbio.store.object.ObjectStore, io.vlingo.symbio.store.object.ObjectStoreReader, io.vlingo.symbio.store.object.ObjectStoreWriter

    public class JPAObjectStoreDelegate
    extends java.lang.Object
    implements JPAObjectStore
    The JDBCObjectStoreDelegate for JPA.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.vlingo.symbio.store.object.ObjectStoreReader

        io.vlingo.symbio.store.object.ObjectStoreReader.QueryMode, io.vlingo.symbio.store.object.ObjectStoreReader.QueryMultiResults, io.vlingo.symbio.store.object.ObjectStoreReader.QueryResult, io.vlingo.symbio.store.object.ObjectStoreReader.QueryResultInterest, io.vlingo.symbio.store.object.ObjectStoreReader.QuerySingleResult
      • Nested classes/interfaces inherited from interface io.vlingo.symbio.store.object.ObjectStoreWriter

        io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest
    • Constructor Summary

      Constructors 
      Constructor Description
      JPAObjectStoreDelegate​(io.vlingo.actors.Stage stage)
      Constructs my default state.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected void createOrUpdate​(java.lang.Object detachedEntity, long updateId)  
      protected java.lang.Object findEntity​(java.lang.Class<?> entityClass, java.lang.Object primaryKey)  
      <T extends io.vlingo.symbio.store.object.PersistentObject,​E>
      void
      persist​(T persistentObject, java.util.List<io.vlingo.symbio.Source<E>> sources, long updateId, io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest interest, java.lang.Object object)  
      <T extends io.vlingo.symbio.store.object.PersistentObject,​E>
      void
      persistAll​(java.util.Collection<T> persistentObjects, java.util.List<io.vlingo.symbio.Source<E>> sources, long updateId, io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest interest, java.lang.Object object)  
      void queryAll​(io.vlingo.symbio.store.object.QueryExpression expression, io.vlingo.symbio.store.object.ObjectStoreReader.QueryResultInterest interest, java.lang.Object object)  
      void queryObject​(io.vlingo.symbio.store.object.QueryExpression expression, io.vlingo.symbio.store.object.ObjectStoreReader.QueryResultInterest interest, java.lang.Object object)  
      void registerMapper​(io.vlingo.symbio.store.object.PersistentObjectMapper mapper)  
      <T extends io.vlingo.symbio.store.object.PersistentObject>
      void
      remove​(T persistentObject, long removeId, io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest interest, java.lang.Object object)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.vlingo.symbio.store.object.ObjectStoreReader

        queryAll, queryObject
      • Methods inherited from interface io.vlingo.symbio.store.object.ObjectStoreWriter

        persist, persist, persist, persist, persist, persist, persist, persistAll, persistAll, persistAll, persistAll, persistAll, persistAll, persistAll
    • Field Detail

      • JPA_MYSQL_PERSISTENCE_UNIT

        public static final java.lang.String JPA_MYSQL_PERSISTENCE_UNIT
        See Also:
        Constant Field Values
      • JPA_HSQLDB_PERSISTENCE_UNIT

        public static final java.lang.String JPA_HSQLDB_PERSISTENCE_UNIT
        See Also:
        Constant Field Values
      • JPA_POSTGRES_PERSISTENCE_UNIT

        public static final java.lang.String JPA_POSTGRES_PERSISTENCE_UNIT
        See Also:
        Constant Field Values
    • Constructor Detail

      • JPAObjectStoreDelegate

        public JPAObjectStoreDelegate​(io.vlingo.actors.Stage stage)
        Constructs my default state.
        Parameters:
        stage - from which to obtain the default logger.
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface io.vlingo.symbio.store.object.ObjectStore
      • persist

        public <T extends io.vlingo.symbio.store.object.PersistentObject,​E> void persist​(T persistentObject,
                                                                                               java.util.List<io.vlingo.symbio.Source<E>> sources,
                                                                                               long updateId,
                                                                                               io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest interest,
                                                                                               java.lang.Object object)
        Specified by:
        persist in interface io.vlingo.symbio.store.object.ObjectStoreWriter
      • persistAll

        public <T extends io.vlingo.symbio.store.object.PersistentObject,​E> void persistAll​(java.util.Collection<T> persistentObjects,
                                                                                                  java.util.List<io.vlingo.symbio.Source<E>> sources,
                                                                                                  long updateId,
                                                                                                  io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest interest,
                                                                                                  java.lang.Object object)
        Specified by:
        persistAll in interface io.vlingo.symbio.store.object.ObjectStoreWriter
      • queryAll

        public void queryAll​(io.vlingo.symbio.store.object.QueryExpression expression,
                             io.vlingo.symbio.store.object.ObjectStoreReader.QueryResultInterest interest,
                             java.lang.Object object)
        Specified by:
        queryAll in interface io.vlingo.symbio.store.object.ObjectStoreReader
      • queryObject

        public void queryObject​(io.vlingo.symbio.store.object.QueryExpression expression,
                                io.vlingo.symbio.store.object.ObjectStoreReader.QueryResultInterest interest,
                                java.lang.Object object)
        Specified by:
        queryObject in interface io.vlingo.symbio.store.object.ObjectStoreReader
      • remove

        public <T extends io.vlingo.symbio.store.object.PersistentObject> void remove​(T persistentObject,
                                                                                      long removeId,
                                                                                      io.vlingo.symbio.store.object.ObjectStoreWriter.PersistResultInterest interest,
                                                                                      java.lang.Object object)
        Specified by:
        remove in interface JPAObjectStore
      • registerMapper

        public void registerMapper​(io.vlingo.symbio.store.object.PersistentObjectMapper mapper)
        Specified by:
        registerMapper in interface io.vlingo.symbio.store.object.ObjectStore
      • findEntity

        protected java.lang.Object findEntity​(java.lang.Class<?> entityClass,
                                              java.lang.Object primaryKey)
      • createOrUpdate

        protected void createOrUpdate​(java.lang.Object detachedEntity,
                                      long updateId)
        Parameters:
        detachedEntity - unmanaged entity to be persisted if does not exist or merged if does exist.
        updateId - the primary key to be used to find the managed entity.