mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-26 07:20:56 +00:00
#1653 - ENH: Add support for ClickHouse database
This commit is contained in:
1 parent
435e1f61fe
commit
aef512a851
17 files changed
+224
-24
No files matched your search
@@ -211,6 +211,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
private final String draftTable;
|
||||
|
||||
private final PartitionMeta partitionMeta;
|
||||
private final String storageEngine;
|
||||
|
||||
/**
|
||||
* DB table comment.
|
||||
@@ -492,6 +493,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
this.dependentTables = deploy.getDependentTables();
|
||||
this.dbComment = deploy.getDbComment();
|
||||
this.partitionMeta = deploy.getPartitionMeta();
|
||||
this.storageEngine = deploy.getStorageEngine();
|
||||
this.autoTunable = EntityType.ORM == entityType && (beanFinder == null);
|
||||
|
||||
// helper object used to derive lists of properties
|
||||
@@ -1970,10 +1972,10 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
DefaultOrmQuery<T> query = new DefaultOrmQuery<>(this, ebeanServer, ebeanServer.getExpressionFactory());
|
||||
query.setPersistenceContext(pc);
|
||||
return query
|
||||
// .select(getIdProperty().getName())
|
||||
// we do not select the id because we
|
||||
// probably have to load the entire bean
|
||||
.setId(id).findOne();
|
||||
// .select(getIdProperty().getName())
|
||||
// we do not select the id because we
|
||||
// probably have to load the entire bean
|
||||
.setId(id).findOne();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2874,6 +2876,13 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType {
|
||||
return partitionMeta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the storage engine.
|
||||
*/
|
||||
public String getStorageEngine() {
|
||||
return storageEngine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the dependent tables for a view based entity.
|
||||
* <p>
|
||||
|
||||
@@ -136,6 +136,8 @@ public class DeployBeanDescriptor<T> {
|
||||
|
||||
private List<IndexDefinition> indexDefinitions;
|
||||
|
||||
private String storageEngine;
|
||||
|
||||
/**
|
||||
* The base database table.
|
||||
*/
|
||||
@@ -275,6 +277,14 @@ public class DeployBeanDescriptor<T> {
|
||||
return Modifier.isAbstract(beanType.getModifiers());
|
||||
}
|
||||
|
||||
public void setStorageEngine(String storageEngine) {
|
||||
this.storageEngine = storageEngine;
|
||||
}
|
||||
|
||||
public String getStorageEngine() {
|
||||
return storageEngine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set to true for @History entity beans that have history.
|
||||
*/
|
||||
@@ -315,7 +325,7 @@ public class DeployBeanDescriptor<T> {
|
||||
this.partitionMeta = partitionMeta;
|
||||
}
|
||||
|
||||
public PartitionMeta getPartitionMeta() {
|
||||
public PartitionMeta getPartitionMeta() {
|
||||
if (partitionMeta != null) {
|
||||
DeployBeanProperty beanProperty = getBeanProperty(partitionMeta.getProperty());
|
||||
if (beanProperty != null) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import io.ebean.annotation.History;
|
||||
import io.ebean.annotation.Index;
|
||||
import io.ebean.annotation.InvalidateQueryCache;
|
||||
import io.ebean.annotation.ReadAudit;
|
||||
import io.ebean.annotation.StorageEngine;
|
||||
import io.ebean.annotation.UpdateMode;
|
||||
import io.ebean.annotation.View;
|
||||
import io.ebean.config.TableName;
|
||||
@@ -154,6 +155,11 @@ public class AnnotationClass extends AnnotationParser {
|
||||
}
|
||||
}
|
||||
|
||||
StorageEngine storage = AnnotationUtil.findAnnotationRecursive(cls, StorageEngine.class);
|
||||
if (storage != null) {
|
||||
descriptor.setStorageEngine(storage.value());
|
||||
}
|
||||
|
||||
DbPartition partition = AnnotationUtil.findAnnotationRecursive(cls, DbPartition.class);
|
||||
if (partition != null) {
|
||||
descriptor.setPartitionMeta(new PartitionMeta(partition.mode(), partition.property()));
|
||||
|
||||
Reference in new issue
Block a user