// mark this property as unidirectional
oneToMany.setUnidirectional(true);
// create the 'shadow' unidirectional property
// which is put on the target descriptor
DeployBeanPropertyAssocOne<?> unidirectional = new DeployBeanPropertyAssocOne(targetDesc, owningType);
unidirectional.setUndirectionalShadow(true);
unidirectional.setNullable(false);
unidirectional.setDbRead(true);
unidirectional.setDbInsertable(true);
unidirectional.setDbUpdateable(false);
targetDesc.setUnidirectional(unidirectional);
// specify table and table alias...
BeanTable beanTable = getBeanTable(owningType);
unidirectional.setBeanTable(beanTable);
unidirectional.setName(beanTable.getBaseTable());
info.setBeanJoinType(unidirectional, true);
// define the TableJoin
DeployTableJoin oneToManyJoin = oneToMany.getTableJoin();
if (!oneToManyJoin.hasJoinColumns()) {
throw new RuntimeException("No join columns");
}
// inverse of the oneToManyJoin
DeployTableJoin unidirectionalJoin = unidirectional.getTableJoin();
unidirectionalJoin.setColumns(oneToManyJoin.columns(), true);
}