The concept we use is pretty straight forward. The row from the database would be represented in a Value Object (VO)
The data access would be handled by a Data Access Object (DAO).
The DAO would be aware of the VO, but not vice versa. The DO is basically all the columns from the query with a getter and setter method for each.
If you are using SUN's free
IDE, it will generate the getters and setters for you automatically.
Right click on a variable, select tools, then select generate R/W property for field.
It will generate a getter and a setter method for the field.
If you need to return more than one row from a database, have the DAO return a collection of VO's.
Again, this keeps the separation of the data from the data source. You could simply write a new DAO for XML documents, and your application would not break.
Also, abstract your DAO's one layer by coding to an interface. Use the interface in your programs, not the actual DAO object. Then it is a no brainer to change implementations. Just use a factory to return an instance of the DAO (interface).
just a thought.
hope this was helpful...