Tuesday, February 27, 2007

Hibernate Criteria

DetachedCriteria criteria = DetachedCriteria.forClass(MyObject.class);
criteria.add(Restrictions.ge("prop1Name", valueObject);
criteria.add(Restrictions.eq("prop2Name", valueObject);
//getHibernateTemplate() returns org.springframework.orm.hibernate3.HibernateTemplate
List list = getHibernateTemplate().findByCriteria(criteria);

Monday, February 26, 2007

Spring Basics

GET BEAN OUT OF SPRING CONFIG FILE

//define location of the config files referenced by the bean(s)
ClassPathXmlApplicationContext springContext = new ClassPathXmlApplicationContext(
new String[]{"classpath*:config1.xml",
"classpath*:/subdir/config2.xml",
"classpath*:etc.xml"});
//get the bean
MyBean myBean = (MyBean)springContext.getBean("myBeanName");

Friday, February 23, 2007

Buzz Stuff

Saas is a new, or maybe not so new buzz word. It stands for Software as a service. It's a web 2.0 rendition of ASP. Of course, there are new characteristics and subtleties attached, but concepts are pretty similar.
As always, wikipedia has the best definition

On-demand Software is a software that runs across the internet in a software as a service model (no software to install).

Service Oriented Architecture (SOA) aims to simplify integration and increase agility by creating well defined and standards-based boundaries between systems.

Apache Collection Utilities

CollectionUtils, SetUtils, Predicates, etc.
o'reilly reference