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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:23:39+00:00 2026-05-13T13:23:39+00:00

i have to table relation one-to-one: message & scheduled_message my hibernate config <class name=Message

  • 0

i have to table relation one-to-one: message & scheduled_message

my hibernate config

<class name="Message" table="message">
    <id name="id" column="id">
        <generator class="native" />
    </id>
    <property name="name" column="name" />
            <one-to-one name="scheduled">
</class>

<class name="ScheduledMessage" table="scheduled_message">
    <id name="id" column="id">
        <generator class="native" />
    </id>
    <property name="startTime" column="start_time" />
    <property name="stopTime" column="stop_time" />
    <many-to-one name="message" column="message_id"
        unique="true" not-null="true" />
</class>

i want when message is deleted, scheduled_message is deleted too, but i dont know how to add on-delete=”cascade” to this relation.

please help me

thanks

Quan

  • 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-13T13:23:40+00:00Added an answer on May 13, 2026 at 1:23 pm

    Hibernate docs say that <one-to-one> supports the cascade atribute. So:

    <one-to-one name="scheduled" cascade="delete" .... />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Cinema table & City table and I have relation with this tables
I have the following entity with the following relation: @Entity @Table(name = bpr_user) public
I have two table Company and Employee. And there relation is Company(one) - Employee(many).
Aheo asks if it is ok to have a table with just one column
I have three table in SQL database such as table Person has relation one
I have a one-to-one relation between an Account and a User table, I'm trying
I have two tables with one_to_one relation between them Table one: User - has
I have 2 tables that their rows have one on one relation.. For you
I have multiple level parent-child tables(GrandParent, Parent and Child, all many to one relation,
I have this table: itemA itemB relation 1 2 0.4 1 3 0.8 2

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.