{
for (int ii = 0; ii < 10; ii++) {
MaxStatCodeRecord maxRecord = load(
MaxStatCodeRecord.class,
new FromOverride(StringCodeRecord.class),
new FieldDefinition(MaxStatCodeRecord.MAX_CODE, Funcs.max(StringCodeRecord.CODE)),
new Where(StringCodeRecord.STAT_CODE, type.code()));
int code = maxRecord != null ? maxRecord.maxCode + 1 : 1;
// DEBUG: uncomment this to test code collision