} else {
if (obj.isSet(p)) {
Relationship relationship = config.getRelationshipByReference(p);
if ((p.getOpposite() != null && p.getOpposite().isMany())
|| (hasState(tw, relationship, obj))) {
RelationshipWrapper r = new RelationshipWrapper(relationship);
Iterator keys = r.getForeignKeys().iterator();
while (keys.hasNext()) {
String key = (String) keys.next();
String keyProperty = config.getColumnPropertyName(tw.getTableName(), key);
Property keyProp = obj.getType().getProperty(keyProperty);
if ( keyProp == null )