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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:28:06+00:00 2026-06-01T06:28:06+00:00

I previously had a table that is created using hibernate entities. I am using

  • 0

I previously had a table that is created using hibernate entities. I am using the hibernate import.sql method to input a bunch of data to run before my unit tests. These are all in insert statements.

Everything was working fine until a design change forced us to switch to using a generated PK instead of the old NaturalId PK. Now none of my inserts are working and hibernate is not spitting out any errors. Please help!

@Entity
@Table(name="PERSON")
@GenericGenerator(name="PERSON_SEQ", strategy = "sequence",
 parameters = { @Parameter(name="sequence", value="PERSON_SEQ") } )
public class PersonEntity implements Serializable {

@Id 
@GeneratedValue( strategy=GenerationType.SEQUENCE, generator="PERSON_SEQ")
@Column(name="PERSON_ID", nullable=false, updatable=false)
private Long id;

@NaturalId
@NotNull
@Min(1)
@Column(name="FIRST_NAME", nullable=false, updatable=false)
private String firstName;

//More code....

And for my insert statements…

INSERT INTO "PERSON" (PERSON_ID, FIRST_NAME, LAST_NAME, SOCIAL_SECURITY) VALUES (PERSON_SEQ.NEXTVAL, 'John', 'Doe', '111111111');

I could care less if inserting via creating a hibernate object works in this case. It’s much more important that the sql insert statements work.

Also, I have hibernate set to INFO and show sql is true, but still no error messages… Any help is greatly appreciated.

  • 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-01T06:28:07+00:00Added an answer on June 1, 2026 at 6:28 am

    I think the issue here has to do with me unit testing in Hypersonic. I am not sure if any of you are familiar with that but that is the unit testing sql dialect my team is using. Thanks for the comments. I’ve been able to solve me issue by doing the following work-around:

    Hardcode the id for certain columns with 1 for the first value and then select max(id) + 1 for each subsequent column. After all data is inserted I then increment the sequence to the proper value with the help of PL/SQL.

    Thanks for your help everyone.

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

Sidebar

Related Questions

I have a single row of data in a SQL Server table that I'm
I have a db table that previously was not null (so every record had
I previously had a post on this issue that was resolved. However since rebuilding
I have an application that uses CoreData. I previously had a class named Marker
Previously we had desktop applications but given the fact that accessing the server (either
previously i had custom tableviewcell and was loading from Nib.in that i have specified
We previously had a database in MySQL. In it, we had a table called
I have a pretty big web application that I created last year using ASP.NET
I'm using MySQL and I have a table that has dates in a column
I am trying to import some data to SQL Server 2008 by means of

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.