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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:53:16+00:00 2026-05-25T14:53:16+00:00

In Play Framework! I defined two models : On one hand, @Entity public class

  • 0

In Play Framework! I defined two models :

On one hand,

@Entity
public class DashboardPosition extends Model  {
    public int orderId;

    @ManyToOne(cascade=CascadeType.ALL)
    public Dashboard dashboard;
}

And on the other hand,

@Entity
public class Dashboard extends Model  {
    ...
}

For some reason, when deleting a dashboard via “dashboard.delete()” I get an error with the following log.

12:07:20,190 DEBUG ~ delete from Dashboard where id=?
12:07:20,204 WARN  ~ SQL Error: 23003, SQLState: 23003
12:07:20,204 ERROR ~ Referential integrity constraint violation: "FKF7C253BD5A49DA96: PUBLIC.DASHBOARDPOSITION FOREIGN KEY(DASHBOARD_ID) REFERENCES PUBLIC.DASHBOARD(ID)"; SQL statement:
delete from Dashboard where id=? [23003-149]
12:07:20,204 WARN  ~ SQL Error: 23003, SQLState: 23003
12:07:20,204 ERROR ~ Referential integrity constraint violation: "FKF7C253BD5A49DA96: PUBLIC.DASHBOARDPOSITION FOREIGN KEY(DASHBOARD_ID) REFERENCES PUBLIC.DASHBOARD(ID)"; SQL statement:
delete from Dashboard where id=? [23003-149]

Which makes me think that cascade is not working in my case.
Any clue of why this might be happening / how to debug this problem?

  • 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-25T14:53:17+00:00Added an answer on May 25, 2026 at 2:53 pm

    The cascade is on the wrong side of the association.

    You want all the dashboard’s positions deleted when you delete a dashboard. But you don’t want the dashboard deleted when you delete one of its positions. The cascade should thus be set on the @OneToMany annotation of the Dashboard’s positions field.

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

Sidebar

Related Questions

in scala play framework I seen this code: abstract class AnalyserInfo case class ColumnC(typeName:String,fieldName:String)
I'm using the Play Framework and taking a text from a textarea and I
I'm using the Play Framework and have a question about templates: I want to
I am developing a project using the Play framework. Yesterday, 'something' happened and my
I am doing an application in play framework in which I need to store
I would like to use Lift-JSON (v2.2) with Play framework to parse a JSON
I am a big fan of Dependency Injection and the Play Framework, but am
I have developed a small application based on Play Framework (I am still learning).
I've read this: http://groups.google.com/group/play-framework/browse_thread/thread/1df0a77ef811a225 but not found the answer in fact i have turned
Since you guys have been very helpful in my early steps into the Play

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.