This commit is contained in:
@@ -9,7 +9,6 @@ import java.io.*;
|
||||
import java.util.*;
|
||||
import javax.annotation.*;
|
||||
import org.redkale.net.sncp.*;
|
||||
import org.redkale.source.DataSource.FuncEnum;
|
||||
import org.redkale.source.*;
|
||||
import org.redkale.util.*;
|
||||
|
||||
|
||||
@@ -16,16 +16,6 @@ import org.redkale.util.*;
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface DataSource {
|
||||
|
||||
public static enum FuncEnum {
|
||||
|
||||
AVG, COUNT, DISTINCTCOUNT, MAX, MIN, SUM;
|
||||
|
||||
public String getColumn(String col) {
|
||||
if (this == DISTINCTCOUNT) return "COUNT(DISTINCT " + col + ")";
|
||||
return this.name() + "(" + col + ")";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建读连接
|
||||
*
|
||||
|
||||
@@ -12,8 +12,7 @@ import java.util.function.*;
|
||||
import java.util.logging.*;
|
||||
import java.util.stream.Stream;
|
||||
import javax.persistence.Transient;
|
||||
import org.redkale.source.DataSource.FuncEnum;
|
||||
import static org.redkale.source.DataSource.FuncEnum.*;
|
||||
import static org.redkale.source.FuncEnum.*;
|
||||
import java.util.stream.*;
|
||||
import org.redkale.util.*;
|
||||
|
||||
|
||||
19
src/org/redkale/source/FuncEnum.java
Normal file
19
src/org/redkale/source/FuncEnum.java
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.redkale.source;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangjx
|
||||
*/
|
||||
public enum FuncEnum {
|
||||
AVG, COUNT, DISTINCTCOUNT, MAX, MIN, SUM;
|
||||
|
||||
public String getColumn(String col) {
|
||||
if (this == DISTINCTCOUNT) return "COUNT(DISTINCT " + col + ")";
|
||||
return this.name() + "(" + col + ")";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user