r5v9 / persist Goto Github PK
View Code? Open in Web Editor NEWPersist is a Java ORM/DAO library designed for high performance, ease of use and integration.
Persist is a Java ORM/DAO library designed for high performance, ease of use and integration.
For several years I've been using some modifications to Persist that allow you to create tables from objects, to be able map objects to arbitrary tables and also to access the names of columns based on their method name (useful when querying). So far these mods are working flawlessly for me and have for a while.
The issues I'm having are:
My testing is very limited. I am using a desktop Java app linked to an HSQLdb with < 10k records. I can't quite wrap my head around setting up the unit tests, so I have no idea if my code will fly with other dbs.
I'm fairly happy with my changes, but there are some weak spots in them and I would like for someone else should review them. (Especially if they might end up being pulled back into the main project.)
Here's a couple of links to old postings on the Persist mailing list that highlight the changes I made:
http://groups.google.com/group/persist/browse_thread/thread/d01dcb323dc57fdf
http://groups.google.com/group/persist/browse_thread/thread/e66a7d45f845d7d1
Persist is really really cool and I'd love to give a little bit back to it.
When you use a newer MySQL driver 5.1.X it does now work properly for column aliases e.g.: SELECT user.name as username from user.
According to this bug report: http://bugs.mysql.com/bug.php?id=31499 method which should be used is resultSetMetaData.getColumnLabel() instead of resultSetMetaData.getColumnName().
Persist.java line 1002 and 1045.
Ondrej
I have found this library really useful to me and of very lightweight. I really appreciate contributors.
Can we have a feature for connection pooling inside Persist framework?
TableMapping.java do not close resultset and it leaves the open cursors.
When you run big programs with lot of queries you get ORA-01000: maximum open cursors exceeded, although maximum cursor in my oracle database is set to 300.
Please see code that open resultset after these 2 comments:
// all column names and types (from db)
// all primary keys (from db)
adding resultSet.close(); statement in two places solves the problem.
Otherwise Metadata cursors "SELECT NULL AS table_cat, c.owner AS table_schem,...." are left open leading to ORA-01000 errors.
Took a while to fix it... please make the changes so that others do not have to spend time solving this error.
Thanks.
Persist looks very promising and I'd love to give it a shot. It would help lower the barrier tremendously if persist artifacts were available in Maven Central.
Doing:
persist.readList(Klass.class, "SELECT * FROM klass WHERE id IN (?)", listOfIds)
should just work
line 152 : final String where = join(primaryKeys, "=?", ",");
Suppose my composite pk is "key1" and "key2", the generated where clause will be :
[where] key1=?,key2=?
while expected :
[where] key1=? and key2=?
What about schemas?
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.