anima
anima copied to clipboard
Minimal database operation library.
 all/one/count等都调用这里,会setMapping  但是分页没有?这样导致page分页的时候,只要是不一致的字段值就为null
如题
表结构 ```sql DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `password` varchar(50) CHARACTER SET...
每使用Anima.atomic一次,就泄露一个连接,跟踪了一下代码,发现在AnimaQuery中,方法 private Connection getConn() { Connection connection = localConnection.get(); return ifNotNullReturn(connection, connection, this.getSql2o().open()); } ifNotNullReturn(connection, connection, this.getSql2o().open()); 这儿无论connection是否为空,都回去调用this.getSql2o().open()打开新的连接,我把这儿改成 if (connection!= null) { return connection; } else{ return this.getSql2o().open(); } 不知道我的理解是否正确
### How increase value by 1?
> 如果属性为TargetId, 使用methodToFieldName方法问题 ``` code public static String methodToFieldName(String methodName) { return capitalize(methodName.replace("get", "")); } ``` ``` code String result = "getTargetId".replace("get", ""); // 输出值为TarId,正确应该是TargetId ``` 可以使用replaceFirst ``` code String...
Anima 是否有对多数据源的支持呢?
oracle 分页支持
Exception in thread "main" org.sql2o.Sql2oException: Keys were not fetched from database. Please set the returnGeneratedKeys parameter in the createQuery() method to enable fetching of generated keys. at org.sql2o.Connection.getKey(Connection.java:190) at com.hellokaton.anima.core.AnimaQuery.save(AnimaQuery.java:1241)...