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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:11:31+00:00 2026-05-15T15:11:31+00:00

I recently added new property in one class, its list property and I have

  • 0

I recently added new property in one class, its list property and I have written xml mapping for that property,due to few reasons I am not suppose to delete database or use create option in hibernate config file to update changes. I have to do it manual by executing sql queries on database.

xml mapping file:

<list name="items" table="ITEM_ITEM_GROUP" lazy="false" cascade="save-update">
    <key column="ITEM_GROUP_ID"></key>
    <list-index column="IG_INDEX" />            
    <many-to-many column="ITEM_ID" class="Item" />
</list>

can anyone please help how do i do it?

  • 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-15T15:11:32+00:00Added an answer on May 15, 2026 at 3:11 pm

    You are not just adding a column, you are adding a table.

    The easiest approach is to use SchemaExport to create an sql script of your database schema. Then you can copy-paste the new table with indexes and everything.

    In this case, you most probably don’t have to change an existing table, just add the new stuff.

    In java, you can call SchemaExport directly from the command line. Take a look at a tutorial like this here.

    In C# you need to write a utility which export the schema, code looks something like this:

    var schemaExport = new SchemaExport(configuration);
    schemaExport                    
      .Execute(
        false,
        false,
        false,
        null,
        fileStream);
    

    It will basically be something like this (depending on your rdms you are using)

    create table ITEM_ITEM_GROUP(
      ITEM_GROUP_ID int not null,
      IG_INDEX int not null,
      ITEM_ID int,
      primary key (ITEM_GROUP_ID, IG_INDEX)
    )
    
    alter table ITEM_ITEM_GROUP
        add constraint FKXXXX
        foreign key (ITEM_GROUP_ID) 
        references YOUR_ENTITY
    
    alter table ITEM_ITEM_GROUP
        add constraint FKXXXX
        foreign key (ITEM_ID) 
        references ITEM
    

    I probably missed something. So it’s best you let Hibernate create the schema and look into the generated SQL.

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

Sidebar

Related Questions

i've recently added a new property to one of my models: public HttpPostedFile AvailabilityImage
I recently added a Disabled property to one of my domain entities. I have
We recently added a new TeamCity build agent. Because it doesn't have ASP.NET MVC
we have recently added a new feature to our software - preview generation for
I have recently added a new Jenkins job to my automation suite to run
I have recently added a new project to Git using Eclipse, but do not
Apple recently added a new constant to the CIDetector class called CIDetectorTracking which appears
I recently added a new column to a MySQL database (featured), then added that
I have recently added a new column (age) to a database table (user). I
I added a new client-side JS lib (typeAheadDemo.js) to my theme recently, but the

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.