com.codingapi.springboot.permission.db.template.H2SQLTemplate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springboot-starter-data-permission Show documentation
Show all versions of springboot-starter-data-permission Show documentation
springboot-starter-data-permission project for Spring Boot
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);
}
}