Results 1 to 2 of 2

Thread: Documentation quesstion

  1. #1
    Join Date
    Mar 2009
    Location
    PHP
    Posts
    56

    Default Documentation quesstion

    Helo guys,

    I dont know if this is just me or this is really what is expected.

    This gave me hell of confusion in my project. Base on the API,

    executeFind

    public List executeFind(HibernateCallback action)
    throws DataAccessException

    Description copied from interface: HibernateOperations
    Execute the specified action assuming that the result object is a List.

    This is a convenience method for executing Hibernate find calls or queries within an action.

    Specified by:
    executeFind in interface HibernateOperations

    Parameters:
    action - calback object that specifies the Hibernate action
    Returns:
    a List result returned by the action, or null
    Throws:
    DataAccessException - in case of Hibernate errors

    when does executeFind return null? Im just confused because when I try to use this method with some query which I know wont return anything, the method returns an emply list. Am I wrong to expect that the method should return null?

    link here: http://static.springsource.org/sprin...ateCallback%29

    Thanks
    -marckun

    ps: this is minor confusion. hope to hear some feedback.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,626

    Default

    It returns null when you decides it should return null. You implement the HibernateCallback, so if you decide on a certain condition to return null that is valid.

    Hibernate by default returns an empty list it basically never returns null for a query.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •