FIX for ManyToOne targetType & OSGI MANIFEST

This commit is contained in:
Eddie Mc Greal
2014-10-14 08:10:31 +02:00
parent 13791a2e58
commit 1065a84709
9 changed files with 224 additions and 1 deletions
@@ -286,6 +286,12 @@ public final class DefaultServer implements SpiEbeanServer {
ddlGenerator = (DdlGenerator)plugin;
}
}
if (ddlGenerator == null){
ddlGenerator = new DdlGenerator();
spiPlugins.add(ddlGenerator);
ddlGenerator.setup(this, this.getDatabasePlatform(), config.getServerConfig());
}
ebeanPlugins = Collections.unmodifiableList(spiPlugins);
}
@@ -6,6 +6,7 @@ import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import javax.persistence.ManyToOne;
import javax.persistence.PersistenceException;
import javax.persistence.Transient;
@@ -273,6 +274,17 @@ public class DeployCreateProperties {
private DeployBeanProperty createProp(DeployBeanDescriptor<?> desc, Field field) {
Class<?> propertyType = field.getType();
ManyToOne manyToOne = field.getAnnotation(ManyToOne.class);
if (manyToOne != null){
Class<?> tt = manyToOne.targetEntity();
if (tt != null && !tt.equals(void.class)){
propertyType = tt;
logger.debug("target type" + tt);
}
}
Class<?> innerType = propertyType;
String specialTypeKey = getSpecialScalarType(field);