Class ContentsDao

    • Constructor Detail

      • ContentsDao

        public ContentsDao​(ConnectionSource connectionSource,
                           Class<Contents> dataClass)
                    throws SQLException
        Constructor, required by ORMLite
        Parameters:
        connectionSource - connection source
        dataClass - data class
        Throws:
        SQLException - upon creation error
    • Method Detail

      • create

        public static ContentsDao create​(GeoPackageCore geoPackage)
        Create the DAO
        Parameters:
        geoPackage - GeoPackage
        Returns:
        dao
        Since:
        4.0.0
      • getTables

        public List<String> getTables​(String dataType)
                               throws SQLException
        Get table names by data type
        Parameters:
        dataType - data type
        Returns:
        table names
        Throws:
        SQLException - upon query error
        Since:
        3.0.1
      • getTables

        public List<String> getTables​(String... dataTypes)
                               throws SQLException
        Get table names by data types
        Parameters:
        dataTypes - data types
        Returns:
        table names
        Throws:
        SQLException - upon query error
        Since:
        4.0.0
      • getContents

        public List<Contents> getContents​(String dataType)
                                   throws SQLException
        Get contents by data type
        Parameters:
        dataType - data type
        Returns:
        list of contents
        Throws:
        SQLException - upon query error
        Since:
        3.0.1
      • getContents

        public List<Contents> getContents​(String... dataTypes)
                                   throws SQLException
        Get contents by data types
        Parameters:
        dataTypes - data types
        Returns:
        list of contents
        Throws:
        SQLException - upon query error
        Since:
        4.0.0
      • getBoundingBox

        public BoundingBox getBoundingBox​(Projection projection)
        Get the bounding box for all tables in the provided projection
        Parameters:
        projection - desired bounding box projection
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        public BoundingBox getBoundingBox​(String table)
        Get the bounding box for the table in the table's projection
        Parameters:
        table - table name
        Returns:
        bounding box
        Since:
        3.1.0
      • getBoundingBox

        public BoundingBox getBoundingBox​(Projection projection,
                                          String table)
        Get the bounding box for the table in the provided projection
        Parameters:
        projection - desired bounding box projection
        table - table name
        Returns:
        bounding box
        Since:
        3.1.0
      • deleteCascade

        public int deleteCascade​(Contents contents)
                          throws SQLException
        Delete the Contents, cascading
        Parameters:
        contents - contents
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteCascade

        public int deleteCascade​(Contents contents,
                                 boolean userTable)
                          throws SQLException
        Delete the Contents, cascading optionally including the user table
        Parameters:
        contents - contents
        userTable - true if a user table
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteCascade

        public int deleteCascade​(Collection<Contents> contentsCollection)
                          throws SQLException
        Delete the collection of Contents, cascading
        Parameters:
        contentsCollection - contents collection
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteCascade

        public int deleteCascade​(Collection<Contents> contentsCollection,
                                 boolean userTable)
                          throws SQLException
        Delete the collection of Contents, cascading optionally including the user table
        Parameters:
        contentsCollection - contents collection
        userTable - true if a user table
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteCascade

        public int deleteCascade​(PreparedQuery<Contents> preparedDelete)
                          throws SQLException
        Delete the Contents matching the prepared query, cascading
        Parameters:
        preparedDelete - prepared delete query
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteCascade

        public int deleteCascade​(PreparedQuery<Contents> preparedDelete,
                                 boolean userTable)
                          throws SQLException
        Delete the Contents matching the prepared query, cascading optionally including the user table
        Parameters:
        preparedDelete - prepared delete query
        userTable - true if a user table
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteByIdCascade

        public int deleteByIdCascade​(String id)
                              throws SQLException
        Delete a Contents by id, cascading
        Parameters:
        id - id
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteByIdCascade

        public int deleteByIdCascade​(String id,
                                     boolean userTable)
                              throws SQLException
        Delete a Contents by id, cascading optionally including the user table
        Parameters:
        id - id
        userTable - true if a user table
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteIdsCascade

        public int deleteIdsCascade​(Collection<String> idCollection)
                             throws SQLException
        Delete the Contents with the provided ids, cascading
        Parameters:
        idCollection - id collection
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteIdsCascade

        public int deleteIdsCascade​(Collection<String> idCollection,
                                    boolean userTable)
                             throws SQLException
        Delete the Contents with the provided ids, cascading optionally including the user table
        Parameters:
        idCollection - id collection
        userTable - true if a user table
        Returns:
        deleted count
        Throws:
        SQLException - upon deletion error
      • deleteTable

        public void deleteTable​(String table)
        Delete the table
        Parameters:
        table - table name