Comments (9)
You need to have getters and setters in your Bean/DTO class that will "match" the column names. So, if you column name is 'loginname' you need a setter: 'getLoginname'. If you column name is 'login_name' you need a setter: 'getLogin_name'. Let me know if you still can't get it to work.
from yank.
Use getLogin_name ?. I don't think it is right style for Java Code Convention. Anyway, thanks for your suggestion.
from yank.
Alternatively, change your table column names. This all works smoothly by matching getters/setters with column names. That's the one constraint.
from yank.
I think you should support some annotation about @table, @column http://screencast.com/t/pqKdGhPVw11V.
from yank.
Yes, I agree.
from yank.
How about a setting that changes between snake-case (db names) and camel-case (Java) ?
from yank.
Actually this looks pretty easy with annotations. DBUtils allows for an override map so something like the following would work with an annotation parser beforehand:
final Map<String, String> columnToPropertyOverrides = new HashMap<>();
columnToPropertyOverrides.put("WIND_DIRECTION", "WindDirection");
BeanProcessor dateForProcessor = new BeanProcessor(columnToPropertyOverrides);
BasicRowProcessor rp = new BasicRowProcessor(dateForProcessor);
from yank.
@Vinhxike This should work fine now. I added the feature and tested it.
from yank.
cool beans
from yank.
Related Issues (20)
- is compatible with r2dbc? HOT 1
- ClassNotFoundException: org.knowm.yank.Yank
- Cannot use insert or insertBatch with SQLite
- Benchmark and compare to other libs HOT 2
- Allow any datasource to be used. HOT 5
- Allow adding a pre-configured HikariDataSource HOT 1
- Replace InsertedIDResultSetHandler with (built-in) ScalarHandler HOT 5
- Add check to make sure there is a default constructor HOT 1
- queryColumnSQLKey is not working as intended HOT 9
- Connection Pooling issue HOT 35
- hikari 2.4.1, compatibility Patch shutdown() to close() HOT 9
- where is the poolname in the new version? HOT 4
- concurrent, multiuser and custom database HOT 2
- how do you get the sql exceptions ? HOT 2
- Include p6spy for better logging HOT 1
- I can't find release 3.3.0 in any maven repo HOT 1
- MariaDB 10.0 HOT 1
- Update dependencies? HOT 1
- Update dependency dbutils to 1.8 HOT 2
- set variables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yank.