Saturday, January 26, 2008

Hibernate Bugs

When I was working with my pet project using hibernate JPA (core 3.2.5 GA) and found that a bug in the following function

public void validateColumns(Dialect dialect, Mapping mapping, TableMetadata tableInfo) {
Iterator iter = getColumnIterator();
while ( iter.hasNext() ) {
Column col = (Column) iter.next();

ColumnMetadata columnInfo = tableInfo.getColumnMetadata( col.getName() );

if ( columnInfo == null ) {
throw new HibernateException( "Missing column: " + col.getName() + " in " + Table.qualify( tableInfo.getCatalog(), tableInfo.getSchema(), tableInfo.getName()));
}
else {
final boolean typesMatch = col.getSqlType( dialect, mapping )
.startsWith( columnInfo.getTypeName().toLowerCase() )
|| columnInfo.getTypeCode() == col.getSqlTypeCode( mapping );
if ( !typesMatch ) {
throw new HibernateException(
"Wrong column type: " + col.getName() +
", expected: " + col.getSqlType( dialect, mapping )
);
}
}
}

}
Basicallly, when you use columnDefinition you have to use the lowercase, as following:
@Column(name = "xxxx", columnDefinition = "text", nullable = false)


and this won't work
@Column(name = "request_url", columnDefinition = "TEXT", nullable = false)
The bug is in the red line that one part converted to lowercase, not another.

Just to be clkear, I have tried to post this on the hibernate forum but cannot register since I got all the code errors and timed out. so I gave up.

Monday, January 21, 2008

Opensource GWT sites

Infoq has listed some of the open source gwt extensions and application in http://www.infoq.com/news/2008/01/gwt-frameworks. Some of them I have played with. Good to know if you are using GWT.

Some usefule Flex links

Here lists some of the sites that I go once for a while:

Saturday, January 19, 2008

Upgrade to Spring-security 2.0.m1

Last night I upgraded my pet project ot using the latest milestone of Spring-security. This is smoothier than I thought. I only need to make two global changes to make it work.
  • change all aceigsecurity to springframework.security in all java/xml/properties files;
  • change all ACEGI_SECURITY to SPRING_SECURITY in all these constants you possibly used.
After that, it is working again. the next step would be to simplify the xml configuration and use new feature provided.

Of course, if you are using Maven2 like I do, you might need to exclude several dependencies since it is still on spring 2.0.6 and I am already on 2.5.1.

How iPhone developed

This is an interesting story to read.

Tuesday, January 15, 2008

A GWT site for you

I just browsed the site http://www.gwtsite.com/ . it has lots of useful information and links to GWT. Great site if you are a GWT lover.

BTW, there is a GWT presentation at Google today. More info can be found here.

Edward Tufte come to town on data visualization

Edward Tufte has written a few classic books on data visualization and teaches a course around once a year in the Bay Area. I just got the info from a co-worker and registered for the 1/31/08 training. I was told that the training class already has 200 people registered! More info at http://www.edwardtufte.com/tufte/courses.

Sunday, January 13, 2008

Hibernate Mapping Cheat Sheet

There is a Cheat sheet for Hibernate at here. good thing is that it is organized pretty nicely. The bad thing is that this is not updated for a while and some of the new stuff is not there yet, like annotation etc.

Xml input and output

What libarary are you using for sererlizing object to and from XML? I use to use the plain XPP3 and Castor

Recently I found that Xstream is pretty neat and simple to use. Anyone has some comments on this since I am going to migrate from Castor to Xstream?

Free IT books

Thanks for this post, I found that this site, scribd, might be a place to go if you want to read some free books online. Just type in the name or keyword and you will think you are lucky.

Saturday, January 12, 2008

JDK 6 update 4 finally comes to my computer

Since I read this post, I was keep pinging Sun for the download page and looks like they only changed it today to make the update 4 available here.

Maven2 Dependency plugin is cool

I got some dependency issues that certain jars got included and I need to find out where the dependencies come from. After downloading the maven-dependency-plugin of version 2.0-alpha-5-SNAPSHOT, just running:
mvn dependency:tree
then you will know which jars are pulled in by which.

Pretty coll and thanks for the good work. Hope you can release a new version early-:)

Friday, January 11, 2008

Bitemporal entity model

Erwin Vervaet gave an interesting presentation and example implementation using the Hibernate3 entity xml. very interesting to read if you have to deal with issues in temporal entity. see this for detail.

some background can also be found from

Some good Java videos

Please see
javalobby

and

Parley

I did not see all of them, but the ones I saw are very good. Educational and informational. enjoy them.