Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

pBeans 2.0 - Not Dead and Now Even Easier

Before I announce this release, I feel I should apologize. I have practically abandoned this project for a couple years now. I see that some users have expressed that they liked the simplicity of pBeans, but were concerned that the project was "dead". Certainly, it appeared inactive and abandoned, but you never know if an open source project is actually "dead". Someone else can always take over and so forth. Either way, I now feel it was my responsibility to keep this project going given that I started it.

The most significant enhancement in pBeans 2.0 is the introduction of annotations in favor of the _ClassInfo decoration. This was an obvious improvement after the introduction of Java 5, and it is basically a must-have in a project like pBeans.

The way pBeans uses annotations follows its original philosophy: Keep things simple, and do as much for the developer as possible. So to make a class persistent you only need to annotate it with

@PersistentClass()

pBeans takes care of the rest. Of course, in real-life applications, you will at least need a unique index and you may not like the table names pBeans generates by default, so you probably end up with an annotation like the following:

@PersistentClass(
table="User",
indexes=@PropertyIndex(
unique=true,
propertyNames="userName"
)
)

That is the typical annotation that I expect a persistent pBeans class to use.

But I didn't stop there. I decided to implement requested features, such as database transactions, auto-increment IDs (MySQL only) and others.

Then I implemented better marshalling and unmarshalling, support for arrays of primitive types and persistent references, support for enum types, global vs. per-class references, and other useful features.

Database support is still an area of weakness in pBeans, admittedly. MySQL is the best tested database, followed by PostgreSQL. In pBeans 2, I have changed the way new databases can be supported. You need only implement a class named net.sourceforge.pbeans.data.[database].DatabaseImpl that extends AbstractDatabase. The [database] placeholder there is the name of the database as used in the JDBC URL. I am hoping that this mechanism will encourage development of database "plug ins".

Visit http://pbeans.sourceforge.net for additional information.

Release Notes: http://sourceforge.net/project/shownotes.php?release_id=496430&group_id=104506

Download: http://sourceforge.net/project/showfiles.php?group_id=104506&package_id=112395

Posted by Jose Solorzano 2007-03-26