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.