mercredi 8 février 2017

What is the name for class used to store row from result set?

For performance reason many report queries performed outside of ORM managed objects.

For storing results I use one-per-query class to hold row of data between DB access method and services.

For example in Java/Hibernate/Spring:

@Repository
public interface DataRepository extends JpaRepository<DataDAO, Long> {

    @Query("select new com.evil.db.XXX(...) from #{#entityName} where ...")
    List<XXX> findXXX(...);      

What is the name for XXX? Is it DTO or DAO? How intermediate storage class is named in pattern books and framework reference manuals?

I usually hold this classes as inner static classes and have no issue to give names appropriate to containing data.

But I like to add suffix for class name if it top level class to represent its role, like traditionally it is done for DAO/Service/Controller/etc...

Aucun commentaire:

Enregistrer un commentaire