Class ComponentInstanceTable

    • Constructor Detail

      • ComponentInstanceTable

        public ComponentInstanceTable()
    • Method Detail

      • fetchComponentInstance

        protected ComponentInstanceRow fetchComponentInstance​(ResultSet rs)
                                                       throws SQLException
        Fetch the current instance row from a resultSet.
        Parameters:
        rs - result set
        Returns:
        the current instance row from a resultSet.
        Throws:
        SQLException - on error
      • getComponentInstance

        public ComponentInstanceRow getComponentInstance​(int id)
                                                  throws SQLException
        Returns the instance with the given id.
        Parameters:
        id - the unique identifier of the component instance
        Returns:
        the instance with the given id.
        Throws:
        SQLException - on error
      • getComponentInstanceOfUserRole

        public ComponentInstanceRow getComponentInstanceOfUserRole​(int userRoleId)
                                                            throws SQLException
        Returns the ComponentInstance of a given user role.
        Parameters:
        userRoleId - id of user role
        Returns:
        the ComponentInstance of a given user role.
        Throws:
        SQLException - on error
      • getAllComponentInstancesInSpace

        public ComponentInstanceRow[] getAllComponentInstancesInSpace​(int spaceId)
                                                               throws SQLException
        Returns all the instances in a given space
        Parameters:
        spaceId - the space id
        Returns:
        all the instances in a given space
        Throws:
        SQLException - on error
      • getAllComponentInstanceIdsInSpace

        public String[] getAllComponentInstanceIdsInSpace​(int spaceId)
                                                   throws SQLException
        Returns all the instance ids in a given space
        Parameters:
        spaceId - the space id
        Returns:
        all the instance ids in a given space
        Throws:
        SQLException - on error
      • getRemovedComponents

        public ComponentInstanceRow[] getRemovedComponents()
                                                    throws SQLException
        Returns all components which has been removed but not definitely deleted
        Returns:
        all components which has been removed but not definitely deleted
        Throws:
        SQLException - on error
      • getAllMatchingComponentInstances

        public ComponentInstanceRow[] getAllMatchingComponentInstances​(ComponentInstanceRow sampleInstance)
                                                                throws SQLException
        Returns the ComponentInstance whose fields match those of the given sample instance fields.
        Parameters:
        sampleInstance - a row with the fields of the component instance
        Returns:
        the ComponentInstance whose fields match those of the given sample instance fields.
        Throws:
        SQLException - on error
      • createComponentInstance

        public void createComponentInstance​(ComponentInstanceRow instance)
                                     throws SQLException
        Inserts in the database a new instance row.
        Parameters:
        instance - a row with the fields of a component instance
        Throws:
        SQLException - on error
      • updateComponentOrder

        public void updateComponentOrder​(int componentId,
                                         int orderNum)
                                  throws SQLException
        Throws:
        SQLException
      • updateComponentInheritance

        public void updateComponentInheritance​(int componentId,
                                               boolean inheritanceBlocked)
                                        throws SQLException
        Throws:
        SQLException
      • updateComponentInstance

        public void updateComponentInstance​(ComponentInstanceRow instance)
                                     throws SQLException
        Updates in the database an instance row.
        Parameters:
        instance - the row with the fields of the component instance
        Throws:
        SQLException
      • isComponentIntoBasket

        public boolean isComponentIntoBasket​(int spaceId,
                                             String name)
                                      throws SQLException
        Check if a named component already exists in given space
        Parameters:
        spaceId - the space id
        name - the name of a component
        Throws:
        SQLException - on error
      • sendComponentToBasket

        public void sendComponentToBasket​(int id,
                                          String tempLabel,
                                          String userId)
                                   throws SQLException
        Delete the space and all his component instances.
        Parameters:
        id - the component id
        tempLabel - the temporary label
        userId - the user id that deletes the space
        Throws:
        AdminPersistenceException - on error
        SQLException
      • restoreComponentFromBasket

        public void restoreComponentFromBasket​(int id)
                                        throws SQLException
        Remove the space from the basket Space will be available again
        Parameters:
        id - the component id
        Throws:
        SQLException - on error
      • moveComponentInstance

        public void moveComponentInstance​(int spaceId,
                                          int componentId)
                                   throws SQLException
        Throws:
        SQLException
      • removeComponentInstance

        public void removeComponentInstance​(int id)
                                     throws SQLException
        Delete a component instance and all his user role sets.
        Parameters:
        id - the component instance identifier
        Throws:
        SQLException - on error