This commit is contained in:
wentch
2015-12-14 14:49:20 +08:00
parent 7b6e4a9a94
commit eafd4cb25d
4 changed files with 20 additions and 13 deletions

View File

@@ -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.*;

View File

@@ -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 + ")";
}
}
/**
* 创建读连接
*

View File

@@ -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.*;

View 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 + ")";
}
}