Well, my flight has been booked. I’m officially going to 360 Flex in Italy. It was really cool of the 360 Flex conference guys making the first of 3 days free and open to the public. Hopefully it’ll get those people who were on the fence about it to make the trip.

I haven’t worked much on this blog lately because I’m finishing up 3 articles for InsideRIA.com on Encrypting Flex Applications. I’ll post links to them here once they go live.

Post to Twitter

Posted by Andrew, filed under 360 Flex, Flex. Date: March 29, 2008, 5:42 pm | No Comments »

Since attending 360Flex in Atlanta, I wanted to learn a bit about skinning with Degrafa. For one of my own personal projects, I needed to create some nice scrollbars that would go with my black and purple color scheme. Now keep in mind that I am NOT a designer. Most of my coding experience before learning Flex/AIR centered around backend Java Servlets and other hidden technology. View-Source is enabled if you wanted to see how it’s done. I still don’t know how to get rid of the stupid white box between the two scrollbars. If someone would like to comment and let me know, that’d be great.

ScrollbarSkinning

Post to Twitter

Posted by Andrew, filed under 360 Flex, as3, Degrafa, Flex. Date: March 9, 2008, 1:07 pm | 7 Comments »

I’m currently in the process of converting the data layer in a server-side Java service to use hibernate. It has a lot of weird joins in the SQL, so the simplest solution for those cases in the code is to use the native SQL passthrough feature of hibernate. Normally when you run

List data = session.createSQLQuery("select field1, field2 .....")
.list();

You get back a java.util.List populated with Object[]’s. You have to reference the individual columns by their index value in order to get data out of them. This has the side-effect that if your database tables every change or columns get re-ordered your code is hosed up and difficult to debug.

A better way I’ve found is to use

List data = session.createSQLQuery("select  field1, field2.....")
.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)
.list();

This has the effect of returning a List containing Map objects for each row. It then becomes a simple matter to retrieve data based on the column name. If columns ever get added or re-ordered in your table your code will continue working.

for (Object object : data)
{
Map row = (Map)object;
System.out.println(row.get("field1") + ", " + row.get("field2"));
}

Post to Twitter

Posted by Andrew, filed under Hibernate. Date: March 7, 2008, 8:34 pm | 3 Comments »