* the table. This will include a datastore identity column called
* "xorm_pk"; other column names will be the same as the field name.
*/
public void setTable(Table table) {
boolean fakeTable = false;
Column pk;
if (table == null) {
fakeTable = true;
table = new Table(clazz.getName());
pk = new Column(table, "xorm_pk");
table.addColumn(pk);
table.setPrimaryKey(pk);
Iterator i = fields.iterator();
while (i.hasNext()) {
FieldDescriptor fd = (FieldDescriptor) i.next();
Column c = new Column(table, fd.name);
table.addColumn(c);
fieldToColumn.put(fd.name, c);
}
} else {
pk = table.getPrimaryKey();