final SqlParameterDefinition definition;
String sn = null;
ManyToOne manyToOne = getAnnotation(objectType, parameterName, ManyToOne.class);
if (manyToOne != null) {
Class<?> subK = checkNotNull(manyToOne.targetEntity(), "targetEntity not set");
JoinColumn joinColumn = getAnnotation(objectType, parameterName, JoinColumn.class);
SqlObjectDefinition<?> od = SqlObjectDefinition.fromClass(subK, config);
checkState( ! od.getIdParameters().isEmpty(), "No id parameters");
if (joinColumn != null)
sn = joinColumn.name();
if (sn == null)
sn = config.getNamingStrategy().propertyToColumnName(parameterName);
FetchType fetch = manyToOne.fetch();
int depth;
if (FetchType.LAZY == fetch) {