Java Code Examples for org.mybatis.generator.api.IntrospectedTable#addPrimaryKeyColumn()

The following examples show how to use org.mybatis.generator.api.IntrospectedTable#addPrimaryKeyColumn() . 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: VirtualPrimaryKeyPlugin.java    From mapper-generator-javafx with Apache License 2.0 5 votes vote down vote up
@Override
public void initialized(IntrospectedTable introspectedTable) {
    String virtualKey = introspectedTable.getTableConfiguration()
            .getProperty("virtualKeyColumns");

    if (virtualKey != null) {
        StringTokenizer st = new StringTokenizer(virtualKey, ", ", false);
        while (st.hasMoreTokens()) {
            String column = st.nextToken();
            introspectedTable.addPrimaryKeyColumn(column);
        }
    }
}
 
Example 2
Source File: VirtualPrimaryKeyPlugin.java    From mybatis-generator-core-fix with Apache License 2.0 5 votes vote down vote up
@Override
public void initialized(IntrospectedTable introspectedTable) {
    String virtualKey = introspectedTable.getTableConfiguration()
            .getProperty("virtualKeyColumns"); //$NON-NLS-1$

    if (virtualKey != null) {
        StringTokenizer st = new StringTokenizer(virtualKey, ", ", false); //$NON-NLS-1$
        while (st.hasMoreTokens()) {
            String column = st.nextToken();
            introspectedTable.addPrimaryKeyColumn(column);
        }
    }
}
 
Example 3
Source File: VirtualPrimaryKeyPlugin.java    From mybatis-generator-plus with Apache License 2.0 5 votes vote down vote up
@Override
public void initialized(IntrospectedTable introspectedTable) {
    String virtualKey = introspectedTable.getTableConfiguration()
            .getProperty("virtualKeyColumns"); //$NON-NLS-1$

    if (virtualKey != null) {
        StringTokenizer st = new StringTokenizer(virtualKey, ", ", false); //$NON-NLS-1$
        while (st.hasMoreTokens()) {
            String column = st.nextToken();
            introspectedTable.addPrimaryKeyColumn(column);
        }
    }
}