#999 - @DiscriminatorColumn columnDefinition is ignored for DDL generation

This commit is contained in:
rob bygrave
2017-05-20 15:03:21 +12:00
parent 88c6ec358c
commit d04954e46f
6 changed files with 69 additions and 9 deletions
@@ -26,6 +26,8 @@ public class InheritInfo {
private final int discriminatorLength;
private final String columnDefn;
private final String where;
private final Class<?> type;
@@ -58,6 +60,7 @@ public class InheritInfo {
this.discriminatorType = deploy.getDiscriminatorType(parent);
this.discriminatorLength = deploy.getDiscriminatorLength(parent);
this.columnDefn = deploy.getColumnDefn();
this.where = InternString.intern(deploy.getWhere());
if (r == null) {
@@ -164,14 +167,14 @@ public class InheritInfo {
public BeanProperty[] localProperties() {
return descriptor.propertiesLocal();
}
/**
* Return the children.
*/
public ArrayList<InheritInfo> getChildren() {
return children;
}
/**
* Get the bean property additionally looking in the sub types.
*/
@@ -342,6 +345,13 @@ public class InheritInfo {
return discriminatorLength;
}
/**
* Return the explicit column definition.
*/
public String getColumnDefn() {
return columnDefn;
}
/**
* Return the discriminator value for this node.
*/
@@ -126,6 +126,7 @@ public class DeployInherit {
info.setDiscriminatorType(Types.VARCHAR);
}
info.setDiscriminatorLength(da.length());
info.setColumnDefn(da.columnDefinition());
}
DiscriminatorValue dv = AnnotationBase.findAnnotation(cls, DiscriminatorValue.class);
@@ -26,6 +26,8 @@ public class DeployInheritInfo {
private String discriminatorColumn;
private String columnDefn;
private String discriminatorWhere;
private final Class<?> type;
@@ -157,6 +159,20 @@ public class DeployInheritInfo {
this.discriminatorType = discriminatorType;
}
/**
* Set explicit column definition (ddl).
*/
public void setColumnDefn(String columnDefn) {
this.columnDefn = columnDefn;
}
/**
* Return the explicit column definition.
*/
public String getColumnDefn() {
return columnDefn;
}
/**
* Return the length of the discriminator column.
*/