Java Code Examples for javax.persistence.Table#catalog()

The following examples show how to use javax.persistence.Table#catalog() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModelSqlUtils.java    From jdbctemplatetool with Apache License 2.0 5 votes vote down vote up
/**
 * 从po类获取表名
 * @return
 */
private static <T> String getTableName(Class<T> clazz) {
	
	Table tableAnno = clazz.getAnnotation(Table.class);
	if(tableAnno != null){
		if(tableAnno.catalog() != null){
			return tableAnno.catalog() + "." + tableAnno.name();
		}
		return tableAnno.name();
	}
	//if Table annotation is null
	String className = clazz.getName();
	return IdUtils.toUnderscore(className.substring(className.lastIndexOf(".")+1));
}
 
Example 2
Source File: EntityTable.java    From tk-mybatis with MIT License 4 votes vote down vote up
public void setTable(Table table) {
    this.name = table.name();
    this.catalog = table.catalog();
    this.schema = table.schema();
}
 
Example 3
Source File: EntityTable.java    From Mapper with MIT License 4 votes vote down vote up
public void setTable(Table table) {
    this.name = table.name();
    this.catalog = table.catalog();
    this.schema = table.schema();
}