/** * Get contents by data type * * @param dataType * data type * @return list of contents * @throws SQLException * upon query error * @since 1.2.1 */ public List<Contents> getContents(ContentsDataType dataType) throws SQLException { return getContents(dataType.getName()); }
/** * Constructor * * @param name * relation name * @param dataType * contents data type */ private RelationType(String name, ContentsDataType dataType) { this(name, dataType.getName()); }
/** * Delete the Contents, cascading optionally including the user table * * @param contents * contents * @param userTable * true if a user table * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(Contents contents, boolean userTable) throws SQLException { int count = deleteCascade(contents); if (userTable) { dropTable(contents.getTableName()); } return count; }
public void setContents(Contents contents) { this.contents = contents; if (contents != null) { tableName = contents.getId(); } else { tableName = null; } }
/** * Set the contents * * @param contents * contents */ public void setContents(Contents contents) { this.contents = contents; if (contents != null) { tableName = contents.getTableName(); } else { tableName = null; } }
/** * Get the projection * * @return projection * @since 3.1.0 */ public Projection getProjection() { return getSrs().getProjection(); }
/** * Delete the collection of Contents, cascading * * @param contentsCollection * contents collection * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(Collection<Contents> contentsCollection) throws SQLException { return deleteCascade(contentsCollection, false); }
/** * Get contents by data type * * @param dataType * data type * @return list of contents * @throws SQLException * upon query error * @since 3.0.1 */ public List<Contents> getContents(String dataType) throws SQLException { List<Contents> contents = queryForEq(Contents.COLUMN_DATA_TYPE, dataType); return contents; }
/** * Get the bounding box for the table in the table's projection * * @param table * table name * * @return bounding box * @since 3.1.0 */ public BoundingBox getBoundingBox(String table) { return getBoundingBox(null, table); }
/** * Delete a Contents by id, cascading * * @param id * id * @return deleted count * @throws SQLException * upon deletion error */ public int deleteByIdCascade(String id) throws SQLException { return deleteByIdCascade(id, false); }
/** * Get the data type * * @return data type */ public ContentsDataType getDataType() { return ContentsDataType.fromName(dataType); }
/** * Delete the Contents with the provided ids, cascading * * @param idCollection * id collection * @return deleted count * @throws SQLException * upon deletion error */ public int deleteIdsCascade(Collection<String> idCollection) throws SQLException { return deleteIdsCascade(idCollection, false); }
/** * {@inheritDoc} * * Verify optional tables have been created */ @Override public int create(Contents contents) throws SQLException { verifyCreate(contents); return super.create(contents); }
/** * {@inheritDoc} */ @Override public ContentsDao getContentsDao() { ContentsDao dao = createDao(Contents.class); dao.setDatabase(database); return dao; }
/** * Set the data type * * @param dataType * data type */ public void setDataType(ContentsDataType dataType) { this.dataType = dataType.getName(); }
/** * Delete the Contents matching the prepared query, cascading * * @param preparedDelete * prepared delete query * @return deleted count * @throws SQLException * upon deletion error */ public int deleteCascade(PreparedQuery<Contents> preparedDelete) throws SQLException { return deleteCascade(preparedDelete, false); }
/** * {@inheritDoc} */ @Override public BoundingBox getContentsBoundingBox(Projection projection) { ContentsDao contentsDao = getContentsDao(); BoundingBox boundingBox = contentsDao.getBoundingBox(projection); return boundingBox; }
/** * {@inheritDoc} */ @Override public List<String> getTables(ContentsDataType type) { return getTables(type.getName()); }
/** * {@inheritDoc} */ @Override public boolean isTableType(ContentsDataType type, String table) { return isTableType(type.getName(), table); }