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

  • Home
  • SEARCH
  • 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 7867761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:47:41+00:00 2026-06-03T00:47:41+00:00

I have some logically deleted records (ie active=false ) which are causing problems with

  • 0

I have some logically deleted records (ie active=false) which are causing problems with my @ManyToOne mapping since more than one result is being returned by the join column.

I need to only include records where active=true which I thought I could achieve by:

@ManyToOne
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "site_id", referencedColumnName = "site_id", insertable = false, updatable = false)
@WhereJoinTable(clause = "active=true")
private Site site;

However, it seems like the WhereJoinTable is not being used by hibernate (perhaps its only valid for OneToMany?) since the active=true does not show up in the generated SQL (logs) and the problem persists.

Is it possible to include a where clause for the join of a ManyToOne and how?

  • 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-06-03T00:47:43+00:00Added an answer on June 3, 2026 at 12:47 am

    @WhereJoinTable is not supported with @ManyToOne. There is bug HHH-4335 about subject open since five years. I am not aware about any workaround, except using view (in the case of read-only access) as mentioned in bug report.

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

Sidebar

Related Questions

I have some XML which contains records and sub records, like this: <data> <record
When you have deleted some previous records in the DB, the auto-incremented record ID
I have some files stored at amazon. all in private mode, and since I
I have some Java code which performs bitwise operations on a BitSet. I have
I have some code which populates a hashtable with a question as the key
I have some data with one row of headers and one or more rows
I have some problems using asyncore with AF_UNIX sockets. This code import asyncore, socket,
I have a file which is an XML representation of some data that is
How do I delete files which have been deleted from the Repo but have
I have some basic questions about core data (which I am new to) and

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.