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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:51:56+00:00 2026-06-07T22:51:56+00:00

For complicated reasons, I have a view defined in my database and I want

  • 0

For complicated reasons, I have a view defined in my database and I want hibernate to be able to read this view, so I mapped it just like it was a regular table. This all seems to be working fine in production.

Now I’m running a test and it’s blowing up. I turned the hibernate show sql and sql comments on and here’s what I found:

Hibernate: /* FROM PostponeDateLimit WHERE postponeDate>=? AND postponeDate <=? AND controlCode = ? ORDER BY postponeDate ASC */ select postponeda0_.REQUEST_DATE as REQUEST1_5_, postponeda0_.COURTLOCATION as COURTLOC2_5_, postponeda0_.ALLOWED as ALLOWED5_, postponeda0_.POSTPONED as POSTPONED5_, postponeda0_.DATECAP as DATECAP5_ from POSTPONE_DATE_VIEW postponeda0_ where postponeda0_.REQUEST_DATE>=? and postponeda0_.REQUEST_DATE<=? and postponeda0_.COURTLOCATION=? order by postponeda0_.REQUEST_DATE ASC    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?    
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?
Hibernate: /* update com.acs.gs.juror.pojo.PostponeDateLimit */ update POSTPONE_DATE_VIEW set ALLOWED=?, POSTPONED=?, DATECAP=? where REQUEST_DATE=? and COURTLOCATION=?
2012-07-18 16:07:44,503 35529 WARN  org.hibernate.util.JDBCExceptionReporter | SQL Error: 4406, SQLState: S1000
2012-07-18 16:07:44,503 35529 ERROR org.hibernate.util.JDBCExceptionReporter | Update or insert of view or function 'EJUROR_POSTPONE_DATE_VIEW' failed because it contains a derived or constant field.

So updating the view is causing the exception.

Only the first query is being initiated by me. The updates appear to be created by hibernate for some strange reason. I can’t for the life of me figure out why and why it’s doing it on my local test box and not on our live box.

Here’s my hibernate mapping:

<class name="com.pojo.PostponeDateLimit" table="POSTPONE_DATE_VIEW">
    <composite-id class="com.acs.gs.juror.pojo.PostponeDateLimitKey" mapped="true">
        <key-property name="postponeDate" type="calendar" column="REQUEST_DATE"/>
        <key-property name="controlCode" column="COURTLOCATION"/>
    </composite-id>
    <property name="maxCount" column="ALLOWED"/>
    <property name="postponedCount" column="POSTPONED"/>
    <property name="dateCap" column="DATECAP"/>
</class>

Does anyone have an insight at all?

  • 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-07T22:51:58+00:00Added an answer on June 7, 2026 at 10:51 pm

    You could make the Entity read-only as per Hibernate documents

    In this case probably best to make the com.pojo.PostponeDateLimit class immutable. This will also catch any code that tries to change the data – which I suspect is what is happening not Hibernate doing something

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

Sidebar

Related Questions

I have some unicode text that I want to clean up using regular expressions.
Python 3 really complicated the whole file reading process, when you have a binary
I have a very complicated site built on CSS3 that has html elements 3d-transformed,
That sounds complicated, doesn't it... actually it's quite easy: I have a multi-language app
I have a rather complicated lookup for an option. It comes from a separate
I have a rather complicated (and very inefficient) way of getting utilisation from a
I have a very complicated form which has multiple stages in it. Each stage
I have a fairly complicated installer that I'm writing in Wix that has a
I have a scenario where I want a web page to contain a <link>
I would like to develop Mac applications, but don't want to use XCode. I

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.