All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.convergence_platform.common.database.blueprints.TableBlueprint Maven / Gradle / Ivy

Go to download

Holds the common functionality needed by all Convergence Platform-based services written in Java.

The newest version!
package io.convergence_platform.common.database.blueprints;

import java.util.ArrayList;
import java.util.List;

public class TableBlueprint {
    public String name;

    public List columns = new ArrayList<>();

    public List indices = new ArrayList<>();

    public boolean checkExistence = false;

    public void addOperationDates() {
        addOperationDates(true, true, true);
    }

    public void addOperationDates(boolean createdAt, boolean updatedAt, boolean deletedAt) {
        if (createdAt) {
            columns.add(new TableColumnBlueprint("created_at", "timestamp", false, false, false, "CURRENT_TIMESTAMP"));
        }

        if (updatedAt) {
            columns.add(new TableColumnBlueprint("updated_at", "timestamp", false, false, true, null));
        }

        if (deletedAt) {
            columns.add(new TableColumnBlueprint("deleted_at", "timestamp", false, false, true, null));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy