hs-web / hsweb-easy-orm Goto Github PK
View Code? Open in Web Editor NEW简单的orm工具,为动态表单而生
简单的orm工具,为动态表单而生
结合第三方中间件或者框架自身可以在哪进行配置拆分条件吗?
问题:
希望框架debug模式下能够支持sql关键字过滤的功能(表名,SELECT, UPDATE, DELETE等等)
场景:
由于项目多处用到了定时器,导致频繁的打印一堆重复sql,因而开发环境下很难分析整个调用链路,需要排除掉很多无用sql
故希望作者大大支持下面类似的sql过滤功能:
public static void printSql(Logger log, SqlRequest sqlRequest, MessageTypeMatcher matcher) {
if (log.isDebugEnabled()) {
if (sqlRequest.isNotEmpty()) {
boolean hasParameter = sqlRequest.getParameters() != null && sqlRequest.getParameters().length > 0;
//过滤sql
if(matcher.match(sqlRequest.getSql())){
return;
}
log.debug("==> {}: {}", hasParameter ? "Preparing" : " Execute", sqlRequest.getSql());
if (hasParameter) {
log.debug("==> Parameters: {}", sqlParameterToString(sqlRequest.getParameters()));
if (sqlRequest instanceof PrepareSqlRequest) {
log.debug("==> Native: {}", sqlRequest.toNativeSql());
}
}
}
}
}
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hsweb-easy-orm-es: Compilation failure
[ERROR] /git/hsweb-easy-orm/hsweb-easy-orm-es/src/main/java/org/hsweb/ezorm/es/simple/SimpleESQuery.java:[18,1] org.hsweb.ezorm.es.simple.SimpleESQuery不是抽象的, 并且未覆盖org.hsweb.ezorm.core.Conditional中的抽象方法sql(java.lang.String,java.lang.Object...)
ddl 创建表 那个很实用
dml那个 我看实例给的只有 指定了一个单表, 所以想知道 关联查询等复杂查询能使用吗?
动态指定 多张表
项目启动时候获取索引元数据是根据索引名称存入HashMap,这样不同表的相同索引名称会相互覆盖,只会保留最后几条记录,应该改为根据表名+索引名做key
Map<String, RDBIndexMetadata> groupByName = new HashMap<>();
public boolean completedWrapRow(Map<String, String> result) {
String name = result.get("index_name");
RDBIndexMetadata index = groupByName.computeIfAbsent(name, __ -> new RDBIndexMetadata());
index.setName(result.get("index_name"));
index.setUnique("0".equals(result.get("non_unique")));
index.setTableName(result.get("table_name"));
index.setPrimaryKey("PRIMARY".equalsIgnoreCase(name));
RDBIndexMetadata.IndexColumn column = new RDBIndexMetadata.IndexColumn();
column.setColumn(result.get("column_name"));
column.setSortIndex(Integer.parseInt(result.get("seq_in_index")));
column.setSort(RDBIndexMetadata.IndexSort.asc);
index.getColumns().add(column);
return true;
}
postgresql中查询时大小写敏感的,需要使用ILIKE关键字,但是TermType未定义,有其他方式可以实现吗
你这orm这块很久没更新了?现在jetlinks还在用这个模块吗?
删除行代码
operator.ddl()
.createOrAlter(collectionName)
.dropColumn(fieldsEntity.getName())
.commit()
.reactive();
删除后数据中确实已经删除了,但是通过以下代码查询出现Unknown column 'cehsi.ceshi' in 'field list'
异常
operator.dml()
.createReactiveRepository(s.getCollectionName())
.createQuery()
.select(getSelectFiled(s).toArray(new String[s.getFields().size() + 4])) // 指定select 也不行同样报错
.setParam(query)
.orderBy(s.getFields().stream().filter(sort -> BooleanUtil.isTrue(sort.getOrderField()))
.map((sort) -> "asc".equals(sort.getOrderDirection()) ? SortOrder.asc(sort.getName()) : SortOrder.desc(sort.getName())).toArray(SortOrder[]::new))
.fetch()
.collect(Collectors.toList()));
关联提交记录 b9af42a
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.