/*
 * Copyright 2016 Patrik Karlsson.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package se.trixon.idd.db.manager;

import com.healthmarketscience.sqlbuilder.dbspec.Constraint;
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbColumn;
import com.healthmarketscience.sqlbuilder.dbspec.basic.DbConstraint;

/**
 *
 * @author Patrik Karlsson
 */
public class ImageInformationManager extends BaseManager {

    public static final String COL_ID = "image_information_id";
    public static final String TABLE_NAME = "image_information";

    public static ImageInformationManager getInstance() {
        return Holder.INSTANCE;
    }

    private ImageInformationManager() {
        mTable = getSchema().addTable(TABLE_NAME);

        mId = mTable.addColumn(COL_ID, "IDENTITY", null);
    }

    @Override
    public void create() {
        String indexName = getIndexName(new DbColumn[]{mId}, "pkey");
        DbConstraint primaryKeyConstraint = new DbConstraint(mTable, indexName, Constraint.Type.PRIMARY_KEY, mId);

        mDb.create(mTable, primaryKeyConstraint);
    }

    private static class Holder {

        private static final ImageInformationManager INSTANCE = new ImageInformationManager();
    }
}

@@ -962,347 +962,2104 @@
 COL_
-ID = %22image_information_id%22;%0A    public static final String TABLE_NAME = %22image_information%22;%0A%0A    public static ImageInformationManager getInstance() %7B%0A        return Holder.INSTANCE;%0A    %7D%0A%0A    private ImageInformationManager() %7B%0A        mTable = getSchema().addTable(TABLE_NAME);%0A%0A        mId = mTable.addColumn(COL_ID, %22IDENTITY%22, null
+COLOR_DEPTH = %22color_depth%22;%0A    public static final String COL_COLOR_MODEL = %22color_model%22;%0A    public static final String COL_CREATION_DATE = %22creation_date%22;%0A    public static final String COL_DIGITIZATION_DATE = %22digitization_date%22;%0A    public static final String COL_FORMAT = %22format%22;%0A    public static final String COL_HEIGHT = %22height%22;%0A    public static final String COL_ORIENTATION = %22orientation%22;%0A    public static final String COL_RATING = %22rating%22;%0A    public static final String COL_WIDTH = %22width%22;%0A    public static final String TABLE_NAME = %22image_information%22;%0A    private final DbColumn mColorDepth;%0A    private final DbColumn mColorModel;%0A    private final DbColumn mCreationDate;%0A    private final DbColumn mDigitizationDate;%0A    private final DbColumn mFormat;%0A    private final DbColumn mHeight;%0A    private final DbColumn mOrientation;%0A    private final DbColumn mRating;%0A    private final DbColumn mWidth;%0A%0A    public static ImageInformationManager getInstance() %7B%0A        return Holder.INSTANCE;%0A    %7D%0A%0A    private ImageInformationManager() %7B%0A        mTable = getSchema().addTable(TABLE_NAME);%0A%0A        mId = mTable.addColumn(ImageManager.COL_ID, %22BIGINT%22, null);%0A        mRating = mTable.addColumn(COL_RATING, %22INT%22, null);%0A        mCreationDate = mTable.addColumn(COL_CREATION_DATE, %22TIMESTAMP%22, null);%0A        mDigitizationDate = mTable.addColumn(COL_DIGITIZATION_DATE, %22TIMESTAMP%22, null);%0A        mOrientation = mTable.addColumn(COL_ORIENTATION, %22INT%22, null);%0A        mWidth = mTable.addColumn(COL_WIDTH, %22INT%22, null);%0A        mHeight = mTable.addColumn(COL_HEIGHT, %22INT%22, null);%0A        mFormat = mTable.addColumn(COL_FORMAT, %22VARCHAR%22, Integer.MAX_VALUE);%0A        mColorDepth = mTable.addColumn(COL_COLOR_DEPTH, %22INT%22, null);%0A        mColorModel = mTable.addColumn(COL_COLOR_MODEL, %22INT%22, null);%0A%0A        String indexName;%0A        BaseManager manager;%0A%0A        manager = ImageManager.getInstance();%0A        indexName = getIndexName(new DbColumn%5B%5D%7Bmanager.getId()%7D, %22fkey%22);%0A        mId.references(indexName, manager.getTable().getName(), manager.getId().getName()
 );%0A 

Enhance image information manager