/** * {@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; }
AttributesTableReader tableReader = new AttributesTableReader( contents.getTableName()); final AttributesTable attributesTable = tableReader.readTable(new AttributesWrapperConnection(database)); attributesTable.setContents(contents); AttributesConnection userDb = new AttributesConnection(database);
/** * {@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; }