Skip to content

Commit

Permalink
2.3.2 修复sql智能处理的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xuejmnet committed Dec 11, 2024
1 parent b365ce5 commit 0b6fb9b
Show file tree
Hide file tree
Showing 33 changed files with 198 additions and 111 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<packaging>pom</packaging>
<version>2.3.1</version>
<version>2.3.2</version>
<name>easy-query</name>
<description>java object query distributed connector</description>
<url>https://github.com/xuejmnet/easy-query</url>
Expand Down
2 changes: 1 addition & 1 deletion sql-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>easy-query-all</artifactId>
<groupId>com.easy-query</groupId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
package com.easy.query.core.expression.segment.condition.predicate;

import com.easy.query.core.basic.jdbc.parameter.ToSQLContext;
import com.easy.query.core.enums.SQLPredicateCompare;
import com.easy.query.core.enums.SQLPredicateCompareEnum;
import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.expression.segment.Column2Segment;
import com.easy.query.core.expression.segment.impl.AbstractSQLNativeSegmentImpl;
import com.easy.query.core.expression.segment.scec.context.core.SQLNativeExpression;
import com.easy.query.core.expression.sql.builder.ExpressionContext;
import com.easy.query.core.metadata.ColumnMetadata;
import com.easy.query.core.util.EasySQLExpressionUtil;

/**
* create time 2023/8/5 12:27
* 文件说明
*
* @author xuejiaming
*/
public class SQLNativeColumnSetPredicate extends AbstractSQLNativeSegmentImpl implements Predicate {

private final Column2Segment column2Segment;

public SQLNativeColumnSetPredicate(Column2Segment column2Segment, ExpressionContext expressionContext, String sqlSegment, SQLNativeExpression sqlNativeExpression) {
super(expressionContext, sqlSegment, sqlNativeExpression);
this.column2Segment = column2Segment;
}

@Override
public TableAvailable getTable() {
return column2Segment.getTable();
}

@Override
public String getPropertyName() {
return column2Segment.getColumnMetadata().getPropertyName();
}

@Override
public Predicate cloneSQLColumnSegment() {
return new SQLNativeColumnSetPredicate(column2Segment,expressionContext,sqlSegment, sqlNativeExpression);
}

@Override
public SQLPredicateCompare getOperator() {
return SQLPredicateCompareEnum.EQ;
}

@Override
public String toSQL(ToSQLContext toSQLContext) {
return column2Segment.toSQL(toSQLContext) +" "+getOperator().getSQL()+" "+ super.toSQL(toSQLContext);
}
}
//package com.easy.query.core.expression.segment.condition.predicate;
//
//import com.easy.query.core.basic.jdbc.parameter.ToSQLContext;
//import com.easy.query.core.enums.SQLPredicateCompare;
//import com.easy.query.core.enums.SQLPredicateCompareEnum;
//import com.easy.query.core.expression.parser.core.available.TableAvailable;
//import com.easy.query.core.expression.segment.Column2Segment;
//import com.easy.query.core.expression.segment.impl.AbstractSQLNativeSegmentImpl;
//import com.easy.query.core.expression.segment.scec.context.core.SQLNativeExpression;
//import com.easy.query.core.expression.sql.builder.ExpressionContext;
//import com.easy.query.core.metadata.ColumnMetadata;
//import com.easy.query.core.util.EasySQLExpressionUtil;
//
///**
// * create time 2023/8/5 12:27
// * 文件说明
// *
// * @author xuejiaming
// */
//public class SQLNativeColumnSetPredicate extends AbstractSQLNativeSegmentImpl implements Predicate {
//
// private final Column2Segment column2Segment;
//
// public SQLNativeColumnSetPredicate(Column2Segment column2Segment, ExpressionContext expressionContext, String sqlSegment, SQLNativeExpression sqlNativeExpression) {
// super(expressionContext, sqlSegment, sqlNativeExpression);
// this.column2Segment = column2Segment;
// }
//
// @Override
// public TableAvailable getTable() {
// return column2Segment.getTable();
// }
//
// @Override
// public String getPropertyName() {
// return column2Segment.getColumnMetadata().getPropertyName();
// }
//
// @Override
// public Predicate cloneSQLColumnSegment() {
// return new SQLNativeColumnSetPredicate(column2Segment,expressionContext,sqlSegment, sqlNativeExpression);
// }
//
// @Override
// public SQLPredicateCompare getOperator() {
// return SQLPredicateCompareEnum.EQ;
// }
//
// @Override
// public String toSQL(ToSQLContext toSQLContext) {
// return column2Segment.toSQL(toSQLContext) +" "+getOperator().getSQL()+" "+ super.toSQL(toSQLContext);
// }
//}
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
package com.easy.query.core.expression.segment.condition.predicate;

import com.easy.query.core.enums.SQLPredicateCompare;
import com.easy.query.core.expression.segment.SQLSegment;
import com.easy.query.core.expression.segment.impl.AbstractSQLNativeSegment2Impl;
import com.easy.query.core.expression.segment.scec.context.core.SQLNativeExpression;
import com.easy.query.core.expression.sql.builder.ExpressionContext;

import java.util.function.Function;

/**
* create time 2023/7/30 21:06
* 文件说明
*
* @author xuejiaming
*/
public class SQLNativePredicate2Impl extends AbstractSQLNativeSegment2Impl implements Predicate {
public SQLNativePredicate2Impl(ExpressionContext expressionContext, SQLSegment sqlSegment, Function<String, String> sqlSegmentFunction, SQLNativeExpression sqlNativeExpression) {
super(expressionContext, sqlSegment,sqlSegmentFunction, sqlNativeExpression);
}

@Override
public Predicate cloneSQLColumnSegment() {
return new SQLNativePredicate2Impl(expressionContext,sqlSegment,sqlSegmentFunction, sqlNativeExpression);
}

@Override
public SQLPredicateCompare getOperator() {
throw new UnsupportedOperationException();
}
}
//package com.easy.query.core.expression.segment.condition.predicate;
//
//import com.easy.query.core.enums.SQLPredicateCompare;
//import com.easy.query.core.expression.segment.SQLSegment;
//import com.easy.query.core.expression.segment.impl.AbstractSQLNativeSegment2Impl;
//import com.easy.query.core.expression.segment.scec.context.core.SQLNativeExpression;
//import com.easy.query.core.expression.sql.builder.ExpressionContext;
//
//import java.util.function.Function;
//
///**
// * create time 2023/7/30 21:06
// * 文件说明
// *
// * @author xuejiaming
// */
//public class SQLNativePredicate2Impl extends AbstractSQLNativeSegment2Impl implements Predicate {
// public SQLNativePredicate2Impl(ExpressionContext expressionContext, SQLSegment sqlSegment, Function<String, String> sqlSegmentFunction, SQLNativeExpression sqlNativeExpression) {
// super(expressionContext, sqlSegment,sqlSegmentFunction, sqlNativeExpression);
// }
//
// @Override
// public Predicate cloneSQLColumnSegment() {
// return new SQLNativePredicate2Impl(expressionContext,sqlSegment,sqlSegmentFunction, sqlNativeExpression);
// }
//
// @Override
// public SQLPredicateCompare getOperator() {
// throw new UnsupportedOperationException();
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.easy.query.core.expression.segment.impl.AbstractSQLNativeSegmentImpl;
import com.easy.query.core.expression.segment.scec.context.core.SQLNativeExpression;
import com.easy.query.core.expression.sql.builder.ExpressionContext;
import com.easy.query.core.expression.visitor.TableVisitor;
import com.easy.query.core.util.EasySQLSegmentUtil;

/**
* create time 2023/7/30 21:06
Expand All @@ -25,4 +27,9 @@ public Predicate cloneSQLColumnSegment() {
public SQLPredicateCompare getOperator() {
throw new UnsupportedOperationException();
}

@Override
public void accept(TableVisitor visitor) {
EasySQLSegmentUtil.paramExpressionTableVisit(sqlNativeExpression.getExpressions(), visitor);
}
}
2 changes: 1 addition & 1 deletion sql-db-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>

<artifactId>sql-db-support</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-clickhouse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-dameng/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-db2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-gauss-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-h2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-kingbase-es/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>sql-kingbase-es</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-mssql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-oracle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-pgsql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-db-support/sql-sqlite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>

<artifactId>sql-extension</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-extension/sql-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-extension/sql-kt-springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-extension/sql-solon-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-extension/sql-springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion sql-ksp-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>

<artifactId>sql-ksp-processor</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>

<artifactId>sql-platform</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-platform/sql-api-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>sql-platform</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>

<artifactId>sql-api-proxy</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion sql-platform/sql-api4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.easy-query</groupId>
<artifactId>easy-query-all</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 0b6fb9b

Please sign in to comment.