/** * {@inheritDoc} */ @Override public AttributesRow newRow() { return new AttributesRow(getTable()); }
/** * {@inheritDoc} */ @Override public AttributesRow getRow(int[] columnTypes, Object[] values) { return new AttributesRow(getTable(), columnTypes, values); }
/** * {@inheritDoc} */ @Override protected AttributesColumn createColumn(AttributesCursor cursor, int index, String name, String type, Long max, boolean notNull, int defaultValueIndex, boolean primaryKey) { GeoPackageDataType dataType = getDataType(type); Object defaultValue = cursor.getValue(defaultValueIndex, dataType); AttributesColumn column = new AttributesColumn(index, name, dataType, max, notNull, defaultValue, primaryKey); return column; }
/** * {@inheritDoc} */ @Override public AttributesDao getAttributesDao(Contents contents) { if (contents == null) { throw new GeoPackageException("Non null " + Contents.class.getSimpleName() + " is required to create " + AttributesDao.class.getSimpleName()); } if (contents.getDataType() != ContentsDataType.ATTRIBUTES) { throw new GeoPackageException(Contents.class.getSimpleName() + " is required to be of type " + ContentsDataType.ATTRIBUTES + ". Actual: " + contents.getDataTypeString()); } // Read the existing table and create the dao AttributesTableReader tableReader = new AttributesTableReader( contents.getTableName()); AttributesConnection userDb = new AttributesConnection(database); final AttributesTable attributesTable = tableReader.readTable(userDb); attributesTable.setContents(contents); AttributesDao dao = new AttributesDao(getName(), database, userDb, attributesTable); return dao; }
/** * {@inheritDoc} */ @Override protected AttributesColumn createColumn(AttributesResultSet result, int index, String name, String type, Long max, boolean notNull, int defaultValueIndex, boolean primaryKey) { GeoPackageDataType dataType = getDataType(type); Object defaultValue = result.getValue(defaultValueIndex, dataType); AttributesColumn column = new AttributesColumn(index, name, dataType, max, notNull, defaultValue, primaryKey); return column; }
/** * {@inheritDoc} */ @Override protected AttributesTable createTable(String tableName, List<AttributesColumn> columnList) { return new AttributesTable(tableName, columnList); }
/** * Create a new primary key column * * @param index * index * @param name * name * @return attributes column */ public static AttributesColumn createPrimaryKeyColumn(int index, String name) { return new AttributesColumn(index, name, GeoPackageDataType.INTEGER, null, true, null, true); }
/** * {@inheritDoc} */ @Override protected AttributesRow newRow() { return getDao().newRow(); }
/** * {@inheritDoc} */ @Override public AttributesRow getRow(int[] columnTypes, Object[] values) { return new AttributesRow(getTable(), columnTypes, values); }
/** * Copy the row * * @return row copy * @since 3.0.1 */ public AttributesRow copy() { return new AttributesRow(this); }
/** * Create a new column * * @param index * index * @param name * name * @param type * data type * @param notNull * not null flag * @param defaultValue * default value * @return attributes column */ public static AttributesColumn createColumn(int index, String name, GeoPackageDataType type, boolean notNull, Object defaultValue) { return createColumn(index, name, type, null, notNull, defaultValue); }
@Override public Cursor wrapCursor(Cursor cursor) { return new AttributesCursor(attributesTable, cursor); } });
/** * {@inheritDoc} */ @Override protected UserInvalidCursor<AttributesColumn, AttributesTable, AttributesRow, ? extends UserCursor<AttributesColumn, AttributesTable, AttributesRow>, ? extends UserDao<AttributesColumn, AttributesTable, AttributesRow, ? extends UserCursor<AttributesColumn, AttributesTable, AttributesRow>>> createInvalidCursor(UserDao dao, UserCursor cursor, List<Integer> invalidPositions, List<AttributesColumn> blobColumns) { return new AttributesInvalidCursor((AttributesDao) dao, (AttributesCursor) cursor, invalidPositions, blobColumns); }
/** * {@inheritDoc} */ @Override protected AttributesResultSet createResult(ResultSet resultSet, int count) { return new AttributesResultSet(table, resultSet, count); }
/** * {@inheritDoc} */ @Override public AttributesRow newRow() { return new AttributesRow(getTable()); }
/** * {@inheritDoc} */ @Override protected AttributesTable createTable(String tableName, List<AttributesColumn> columnList) { return new AttributesTable(tableName, columnList); }
/** * Create a new column * * @param index * index * @param name * name * @param type * data type * @param max * max value * @param notNull * not null flag * @param defaultValue * default value * @return attributes column */ public static AttributesColumn createColumn(int index, String name, GeoPackageDataType type, Long max, boolean notNull, Object defaultValue) { return new AttributesColumn(index, name, type, max, notNull, defaultValue, false); }
/** * {@inheritDoc} */ @Override protected AttributesRow newRow() { return getDao().newRow(); }
/** * Copy the row * * @return row copy * @since 3.0.1 */ public AttributesRow copy() { return new AttributesRow(this); }
/** * {@inheritDoc} */ @Override protected AttributesCursor wrapCursor(Cursor cursor) { return new AttributesCursor(null, cursor); } }