mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add support for Postgres range partition DDL plus refactor xsd definitions that had got out of sync (#1465)
* Add partition meta mapping * Fix to allow schema prefix on select dynamic formula * Add partition meta mapping * Migration XSD Update * Fix to allow schema prefix on select dynamic formula * Bump ebean-migration to 11.8.1
This commit is contained in:
@@ -7,6 +7,7 @@ import io.ebean.SqlUpdate;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.ValuePair;
|
||||
import io.ebean.annotation.DocStoreMode;
|
||||
import io.ebean.annotation.PartitionMode;
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.bean.EntityBeanIntercept;
|
||||
@@ -204,6 +205,8 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
|
||||
private final String draftTable;
|
||||
|
||||
private final PartitionMeta partitionMeta;
|
||||
|
||||
/**
|
||||
* DB table comment.
|
||||
*/
|
||||
@@ -482,6 +485,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
this.baseTableVersionsBetween = deploy.getBaseTableVersionsBetween();
|
||||
this.dependentTables = deploy.getDependentTables();
|
||||
this.dbComment = deploy.getDbComment();
|
||||
this.partitionMeta = deploy.getPartitionMeta();
|
||||
this.autoTunable = EntityType.ORM == entityType && (beanFinder == null);
|
||||
|
||||
// helper object used to derive lists of properties
|
||||
@@ -2816,6 +2820,20 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
return dbComment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if foreign keys to the base table should be suppressed.
|
||||
*/
|
||||
public boolean suppressForeignKey() {
|
||||
return partitionMeta != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the partition details of the bean.
|
||||
*/
|
||||
public PartitionMeta getPartitionMeta() {
|
||||
return partitionMeta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the dependent tables for a view based entity.
|
||||
* <p>
|
||||
@@ -3160,7 +3178,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
public boolean hasIdPropertyOnly(EntityBeanIntercept ebi) {
|
||||
return ebi.hasIdOnly(idPropertyIndex);
|
||||
}
|
||||
|
||||
|
||||
public boolean isIdLoaded(EntityBeanIntercept ebi) {
|
||||
return ebi.isLoadedProperty(idPropertyIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user