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 7603059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:34:20+00:00 2026-05-30T23:34:20+00:00

My goal is to use the MSSQL Fulltext Function with HQL. For what case

  • 0

My goal is to use the MSSQL Fulltext Function with HQL. For what case I wrote a specific SQLFunction mapping the my “fulltext” function to the contains function.

However, the problem is that in HQL (it seems) I have to explicity use a return type, which the MSSQL Contains functions does not use or accepts.

This is how it works in MSSQL:

select distinct id from content c where CONTAINS(c.content, 'p')

This is my idea of using it in HQL:

select id from Content c  where fulltext(c.content, 'p') 

This does not work, since HQL needs a return type. For example this will parse in HQL:

select id from Content c  where fulltext(c.content, 'p') = true

And it will generate as SQL:

select distinct id from content c where CONTAINS(c.content, 'p') = 1

which will not work in MS SQL.

My ideas are so far but what does not seem possible in this setup:

  1. Make hibernate parse functions with no return value (Hibernate does not support this in my version used)
  2. Trying to mix HQL and SQL (also does not seem to work)

Anyone got another idea or help?

My Hibernate Version used is 3.2.6ga and MSSQL Server 2008.

  • 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-30T23:34:21+00:00Added an answer on May 30, 2026 at 11:34 pm

    I found a way what works for me.

    Instead of generating

    CONTAINS(a,b) 
    

    it will generate

    CONTAINS(a,b) AND 1
    

    And in conjunction with the HQL Query

    fulltext(a,b) = true
    

    It will result in:

    CONTAINS(a,b) AND 1 = 1 
    

    And it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to use a script that will install an executable file on
my goal is to get lots of rows from a translation table. I use
My ultimate goal is to load controls as plugins, for use as DocumentContent in
I'm trying to create a custom DQL function to allow me to use the
I'm experiencing a problem with MySQL's GROUP_CONCAT function. I will illustrate my problem using
I'm trying to setup my project so that I can use querydsl-sql against a
Meet Jimmy. He has made his new life goal to prove that Chocolate is
I have a MySql database that contains people's names. Of course there are names
I'm creating my first android app that will make use of SQlite. I have
Goal Java client for Yahoo's HotJobs Resumé Search REST API . Background I'm used

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.