generator icon indicating copy to clipboard operation
generator copied to clipboard

Bug: don't generate XXXWithBLOBs model if the table has only one BLOB column.

Open ruknow opened this issue 9 years ago • 2 comments

Method: org.mybatis.generator.internal.rules.ConditionalModelRules.generateRecordWithBLOBsClass Line: 84 ` public boolean generateRecordWithBLOBsClass() { int otherColumnCount = introspectedTable.getPrimaryKeyColumns().size() + introspectedTable.getBaseColumns().size();

    return otherColumnCount > 1
            && introspectedTable.getBLOBColumns().size() > 1;  //this line
}

to be: && introspectedTable.getBLOBColumns().size() > 0;`

ruknow avatar May 09 '17 07:05 ruknow

@ruknow I think this is not bug... If you set defaultModelType "conditional"(http://www.mybatis.org/generator/configreference/context.html), BLOBs model generates when table has two or more BLOB columns. How about set your context attribute like this: <context defaultModelType="hierarchical">

ghost avatar May 10 '17 08:05 ghost

@TroyTae I see, thank you!

ruknow avatar May 16 '17 12:05 ruknow