Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 641403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:03:32+00:00 2026-05-13T21:03:32+00:00

In this example com.test.Cat extends com.test.Animal and there is no field DB in CAT

  • 0

In this example com.test.Cat extends com.test.Animal and there is no field DB in CAT table of com.test.Cat explicitly defining its type (it wasn’t me).

When I query my animals from DB I get a collection of Animals.

It is possible to sort them by class name:

order by r.class

but is there a way to use class name as a criteria? For example I would like to get all animals expect dogs. But no luck – even this does not work:

where r.class = ?      (String "ccc.test.Cat")

as I get an exception:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
    at org.hibernate.type.IntegerType.set(IntegerType.java:64)
    at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:154)
    at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)
    at org.hibernate.param.PositionalParameterSpecification.bind(PositionalParameterSpecification.java:62)
    at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:514)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1589)
    at org.hibernate.loader.Loader.doQuery(Loader.java:696)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    at org.hibernate.loader.Loader.doList(Loader.java:2228)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
    at org.hibernate.loader.Loader.list(Loader.java:2120)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:03:32+00:00Added an answer on May 13, 2026 at 9:03 pm

    According to the chapter 14.9 of the documentation, you shouldn’t use double quotes:

    The special property class accesses
    the discriminator value of an instance
    in the case of polymorphic
    persistence. A Java class name
    embedded in the where clause will be
    translated to its discriminator value.

    from Cat cat where cat.class = DomesticCat
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to handle links like this: http://example.com/test.aspx?userid=tras&server=bum I looked here , and they
Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
When you create a new Uri like this: New Uri(New Uri(http://example.com/test.php),?x=y) it returns: http://example.com/?x=y
I'm really confused here, can someone explain this to me? request: http://example.com/test.php?var=String's $a =
I basically want to do this: grep 'example.com' www_log > example.com.YYYY-MM-DD-H:i:S.log ...with of course
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
I have a webpage (say www.example.com/a.asp) .. I am having an iframe in this
My php is weak and I'm trying to change this string: http://www.example.com/backend.php?/c=crud&m=index&t=care ^ to
Take a very simple case as an example, say I have this URL: http://www.example.com/65167.html
Recently I've been seeing a lot of this: <a href='http://widget-site-example.com/example.html'> <img src='http://widget-site-example.com/ross.jpg' alt='Ross&#39;s Widget'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.