domain « Query « JPA Q&A





1. Specification Pattern vs Specific Hibernate Query    stackoverflow.com

My question is when to use a specification pattern, and when to use specific SQL query. I understood that specific pattern need to collect whole collection and post filter using concrete specification. ...

2. Where to put object-oriented queries in a layered architecture?    stackoverflow.com

Given:

  • You have an architecture with the layers presentation, business and data.
  • You are applying domain-driven design.
  • You are using an object-relational mapper that lets you create object-oriented queries (e.g., NHibernate which lets you ...

3. translating specifications into query predicates    stackoverflow.com

I'm trying to find a nice and elegant way to query database content based on DDD "specifications". In domain driven design, a specification is used to check if some object, also known ...

4. Can't access a stand alone domain object in hql namedQuery    stackoverflow.com

First I need to apologize for the long post, I struggle with being overly verbose and yet not always clear enough. I also have searched extensively for an elegant solution for ...

5. Return full domain object from Grails / GORM projection    stackoverflow.com

I would like to get a list containing the most recent book written by each of a list of given authors. I tried this:

List books = Book.withCriteria {
  inList('author', authors)
 ...

6. Ordering a Set within a domain object    stackoverflow.com

I am using Hibernate and JPA. I currently have reverse engineered DAO which gives me a list of all 50 States. Within each state is a list of items. Set<Items> The ...

7. database selection by domain    forum.hibernate.org

Hi people, for my webapp I was wondering if there is a way I can configure hibernate so that when i receive a request on a different subdomain, a different database will be used example: for requests on dom1.mysite.com -> use db 'central' for requests on dom2.mysite.com -> use db 'central2' i guess i could run 2 separate servers, with 2 ...

8. query regarding Domain Object    forum.hibernate.org

I am using Hibernate3. Is there any way that i ll get a Domain Object in the form that some of its field value should come as null and some as the value that is present in DB in spite the all field values are present in DB? But some times i also need the full Object means all fields of ...

9. How to order a set within a domain object ?    forum.hibernate.org

I have a domain object which has a set ( diff domain object ) within it. public class Domain_A { private Set bdata; } When domain_A object is retrieved the set also get retrieved. But then the order by which domain_b is retrieved is arbitrary most of the time. I need to have a ORDER BY on the set ( domain_b). ...





10. newb question on how to use query inside domain object    forum.hibernate.org

I have my business/domain objects, lets say Customer. I have a CustomerDAO interface and an implementation of it. Now inside my Category object I want a method called 'getOrders' which executes a Hibernate Query to retreive certain 'Order' objects. I don't want to use a mapped field for this, I want to execute a Query each time, as the orders returned ...