Question:
If you need to have the power of stored procedures and the cleanliness of persistence abstraction (Hibernate, CMP, JDO),
how should you design the architecture?
Example:
class BookDataAccessObject {
public void save(Book book){
//small and simple pojo great for
//persistence framework.
persister.save(book);
}
public double getCrossRefGMROIByPublisher(Book book) {
//complex set logic, much better left at the db.
callableGMROI.executeQuery();
...
}
}
It seems ugly to mix framework and sp's, but overly simplistic to pick one or the other and live with it.
Any ideas about partitioning this type of object?
I'm thinking that you could have the DAO framework and a separate command interface for the sp's, but then you can't
share connection information as easily, for example
persister.connection().prepareCall();
???
How to make this clean?
If you need to have the power of stored procedures and the cleanliness of persistence abstraction (Hibernate, CMP, JDO),
how should you design the architecture?
Example:
class BookDataAccessObject {
public void save(Book book){
//small and simple pojo great for
//persistence framework.
persister.save(book);
}
public double getCrossRefGMROIByPublisher(Book book) {
//complex set logic, much better left at the db.
callableGMROI.executeQuery();
...
}
}
It seems ugly to mix framework and sp's, but overly simplistic to pick one or the other and live with it.
Any ideas about partitioning this type of object?
I'm thinking that you could have the DAO framework and a separate command interface for the sp's, but then you can't
share connection information as easily, for example
persister.connection().prepareCall();
???
How to make this clean?