• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate query using a custom user type  RSS feed

David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • 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 is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!