Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: DetachedCriteria

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DetachedCriteria

    from user u, company c where c.name = u.name

    how can do the same thing using DetachedCriteria, I did it using HQL. but thats not what I wanted ?

    thnx in advance

  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: DetachedCriteria

    If name is a String then you should write:
    c.name.equals(u.name);
    instead.

    Since I have no idea what DetachedCriteria is I have no idea what you are asking.
    Improving the world one idiot at a time!

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: DetachedCriteria

    I presume this is a Hibernate question, so moved to JDBC forum. That being said, given the context (or lackthereof) most would have no clue what you are talking about. Recommend you elaborate a lot more if you want help. Or, if this truly a Hibernate question, ask at the source with the necessary information. Oh wait...you already did (but with the same lack of information)

    This thread has been cross posted here:

    https://forum.hibernate.org/viewtopic.php?f=1&t=1026297

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting