mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 16:47:18 +00:00
#1453 - @Formula property included in DDL when on @Inheritance bean and without @Transient
This commit is contained in:
@@ -133,8 +133,7 @@ public class VisitAllUsing {
|
||||
InheritInfo inheritInfo = descriptor.getInheritInfo();
|
||||
if (inheritInfo != null && inheritInfo.isRoot()) {
|
||||
// add all properties on the children objects
|
||||
InheritChildVisitor childVisitor = new InheritChildVisitor(this, pv);
|
||||
inheritInfo.visitChildren(childVisitor);
|
||||
inheritInfo.visitChildren(new InheritChildVisitor(this, pv));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,9 +154,10 @@ public class VisitAllUsing {
|
||||
|
||||
@Override
|
||||
public void visit(InheritInfo inheritInfo) {
|
||||
BeanProperty[] propertiesLocal = inheritInfo.desc().propertiesLocal();
|
||||
for (BeanProperty aPropertiesLocal : propertiesLocal) {
|
||||
owner.visit(pv, aPropertiesLocal);
|
||||
for (BeanProperty beanProperty : inheritInfo.desc().propertiesLocal()) {
|
||||
if (beanProperty.isDDLColumn()) {
|
||||
owner.visit(pv, beanProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.annotation.Formula;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@@ -9,6 +11,9 @@ public class Cat extends Animal {
|
||||
|
||||
String name;
|
||||
|
||||
@Formula(select = "${ta}.species")
|
||||
String catFormula;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -17,4 +22,11 @@ public class Cat extends Animal {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCatFormula() {
|
||||
return catFormula;
|
||||
}
|
||||
|
||||
public void setCatFormula(String catFormula) {
|
||||
this.catFormula = catFormula;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user