• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Hibernate query using a custom user type

Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I'm trying to create a Hibernate query. Here's my named query that works so far that I define in my mapping file:

What I'm trying to add is the following:
* there's an object in the AlarmInfo class called "level" that I map as a custom Hibernate user type (it implements org.hibernate.usertype.UserType).
* I only want to retrieve an alarmInfo object if it's alarmInfo.level is in a collection of alarm levels.

I tried to do the following:

This, however, doesn't seem to work. I feel like since the "level" is mapped as a Hibernate UserType I should be doing something differently. Any ideas?

It's a tiny ad only because the water is so cold.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic