Giter Club home page Giter Club logo

persist's People

Contributors

grgz avatar r5v9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

persist's Issues

New Features: Creating Tables & Mapping Objects to Multiple Tables

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:

  1. 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.

  2. 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.

Column name vs column label

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

Provide Connection Pooling in Persist

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 do not close Resultset leading to ORA-01000: maximum open cursors exceeded

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.

Maven artifact

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.

TableMapping issue

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=?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.