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

com.codingapi.springboot.permission.db.template.H2SQLTemplate Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.codingapi.springboot.permission.db.template;

/**
 * @author lorne
 * @since 1.0.0
 */
public class H2SQLTemplate implements SQLTemplate{

    private final static String BASE_CREATE_SQL = "CREATE TABLE %s " +
            "(ID INTEGER GENERATED BY DEFAULT AS IDENTITY, " +
            "CREATE_TIME TIMESTAMP, " +
            "USER_ID INTEGER NOT NULL, " +
            "P_ID INTEGER NOT NULL, " +
            "PRIMARY KEY (ID))";

    @Override
    public boolean match(String driverName) {
        return "H2 JDBC Driver".equalsIgnoreCase(driverName);
    }

    @Override
    public String create(String tableName) {
        return String.format(BASE_CREATE_SQL,tableName);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy