Class BasicDBListener

    • Constructor Detail

      • BasicDBListener

        public BasicDBListener()
    • Method Detail

      • init

        public boolean init​(Plugin plugin)
        Description copied from interface: PluginComponent
        Initialize the component with the given plugin configuration
        Specified by:
        init in interface PluginComponent
        Parameters:
        plugin - the calling plugin
        Returns:
        true if the component has been correctly initialized.
        Since:
        jcms-6.0.0
        See Also:
        PluginComponent.init(Plugin)
      • onPostInsert

        public void onPostInsert​(DBData data,
                                 org.hibernate.event.PostInsertEvent event,
                                 boolean firstTime)
        Description copied from interface: DBListener
        This method is called after a DBData has been created.
        Specified by:
        onPostInsert in interface DBListener
        Parameters:
        data - the data.
        event - the event.
        firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
        Since:
        jcms-6.0.0
        See Also:
        DBListener.onPostInsert(DBData, PostInsertEvent, boolean)
      • onPostUpdate

        public void onPostUpdate​(DBData data,
                                 org.hibernate.event.PostUpdateEvent event,
                                 boolean firstTime)
        Description copied from interface: DBListener
        This method is called after a DBData has been updated.
        Specified by:
        onPostUpdate in interface DBListener
        Parameters:
        data - the data.
        event - the event.
        firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
        Since:
        jcms-6.0.0
        See Also:
        DBListener.onPostUpdate(DBData, PostUpdateEvent, boolean)
      • onPostDelete

        public void onPostDelete​(DBData data,
                                 org.hibernate.event.PostDeleteEvent event,
                                 boolean firstTime)
        Description copied from interface: DBListener
        This method is called after a DBData has been deleted.
        Specified by:
        onPostDelete in interface DBListener
        Parameters:
        data - the deleted DBData. WARNING! In a JSync Cluster, when firstTime is false, this data will be null. In this case, to get information about this deleted data, you must use the event and in particular event.getId(), which returns the JPlatform ID of the data, and event.getDeletedState() which returns the attributes of the data.
        event - the event
        firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
        Since:
        jcms-6.0.0
        See Also:
        DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)
      • hasNoChange

        public boolean hasNoChange​(org.hibernate.event.PreUpdateEvent event)
      • hasNoChange

        public boolean hasNoChange​(org.hibernate.event.PostUpdateEvent event)
      • getCdateFromState

        public java.util.Date getCdateFromState​(java.lang.Object[] state)
        Returns the cdate from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the cdate from the given hibernate state.
        Since:
        jcms-6.0.0
      • getMdateFromState

        public java.util.Date getMdateFromState​(java.lang.Object[] state)
        Returns the mdate from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the mdate from the given hibernate state.
        Since:
        jcms-6.0.0
      • getAuthorIdFromState

        public java.lang.String getAuthorIdFromState​(java.lang.Object[] state)
        Returns the authorId from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the authorId from the given hibernate state.
        Since:
        jcms-6.0.0
      • getPstatusFromState

        public int getPstatusFromState​(java.lang.Object[] state)
        Returns the pstatus from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the pstatus from the given hibernate state.
        Since:
        jcms-6.0.0
      • getPdateFromState

        public java.util.Date getPdateFromState​(java.lang.Object[] state)
        Returns the pdate from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the pdate from the given hibernate state.
        Since:
        jcms-6.0.0
      • getEdateFromState

        public java.util.Date getEdateFromState​(java.lang.Object[] state)
        Returns the edate from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the edate from the given hibernate state.
        Since:
        jcms-6.0.0
      • getAdateFromState

        public java.util.Date getAdateFromState​(java.lang.Object[] state)
        Returns the adate from the given hibernate state.
        Parameters:
        state - the state
        Returns:
        the adate from the given hibernate state.
        Since:
        jcms-6.0.0
      • getPrePstatus

        public int getPrePstatus​(org.hibernate.event.PreUpdateEvent event)
        Returns the pstatus from the given PreUpdateEvent.
        Parameters:
        event - the event
        Returns:
        the pstatus from the given PreUpdateEvent.
        Since:
        jcms-6.0.0
      • getPrePstatus

        public int getPrePstatus​(org.hibernate.event.PostUpdateEvent event)
        Returns the pstatus from the given PostUpdateEvent.
        Parameters:
        event - the event
        Returns:
        the pstatus from the given PostUpdateEvent.
        Since:
        jcms-6.0.0
      • getDateFromState

        public java.util.Date getDateFromState​(java.lang.Object[] state,
                                               int index)
        Returns the given date from the given hibernate state.
        Parameters:
        state - the state
        index - the index of the date field in the state
        Returns:
        the given date from the given hibernate state.
        Since:
        jcms-8.0.2