Pencils Down

This weblog is about my experiences in software development

Browsing Posts published in May, 2009

This is really very cute:

Pick a stupid database connection (the plugin install provides the Xtreme db sample).

Grab a table and plunk it into the Data section of the report

Create your POJO

Under the Crystal Reports tab at the top of the screen in Eclipse click on Set Data Source

Click OK on the warning (doesn’t really mean anything as far as I can tell so far)

Select the New POJO option

Specify the POJO package/class you created above

In the discrepancy comparison between the dummy db table and the POJO either Remove and change every column as you see fit.  All of the Remove options must be eliminated.

Hit Ok.

You now have your POJO as the CR data source.

BTW, if you change the POJO then you have to go through a similar set of steps.

By MEG KINNARD, Associated Press Writer Meg Kinnard, Associated Press Writer Wed May 20, 12:10 pm ET

COLUMBIA, S.C. – Craigslist chief executive is suing South Carolina’s attorney general, claiming the prosecutor’s threat to file prostitution charges against the San Francisco company is unreasonable.

CEO Jim Buckmaster says on his blog he wants a restraining order to keep Attorney General Henry McMaster from pursuing criminal charges.

McMaster said last week he would prosecute Craigslist executives for aiding and abetting prostitution if an ad on the site leads to a prostitution case in South Carolina. McMaster has said his office is investigating, but no charges have been brought.

In a statement, McMaster says the lawsuit shows Craigslist is taking his investigation seriously and called it a victory. The lawsuit was filed late Tuesday night in a federal court in South Carolina.

Yahoo News

 
I love this: craigslist is a devout free speech, play by the rules company. Along comes a schmuck politico from the South attempting to push them around. Craigslist just sues the guy. I know there was a reply by the founder the other day pointing to legal documents that the same pol agreed to earlier.

The normal Hibernate entity collection returns a Set<?>.  This is slightly deceptive for Java developers because it would appear that you can perform standard Set operations on the entity collection and have Hibernate do the right thing.  This is an invalid assumption.

For example, Set.clear() would appear to remove all elements in the collection.  In reality it is not clear what Hibernate may do when you perform this step.

Once you realize the clear() call did not work the typical work might be to create a Set in memory from the entity.getCollection() call assuming that your memory Set exists as a separate object.  Again, this is an invalid assumption.  What you have done with the statement Set<?> set = entity.getCollection() is actually copy the Hibernate proxied object into your memory Set object.  As such it will be maintained just as if you left it in the original entity in the first place.

The result is to take the Set and copy all the materialized objects out of the Hibernate Set into some other collection, as in:

List<?> list = new ArrayList<?>();

list.addAll(hibernateSet);

You now finally have a collection that will NOT be maintained by Hibernate that you can operate on directly.

This error message usually means your database has bad references between tables.  As Hibernate will enforce the integrity of these relations this is usually caused via some data load operation.

A recurring situation with us was using a data load script that was O/S dependent.  So, it would work great on Windows and then the same script running on Redhat would throw spurious data into elements.

Particularly hard to detect are String keys where trailing spaces do not normally display when using SQL tools, but are present and cause a mismatch on keys.