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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:23:02+00:00 2026-05-23T16:23:02+00:00

I have a table with composite primary key, one of the PK fields is

  • 0

I have a table with composite primary key, one of the PK fields is a String (group) and the other an integer (id), which is assigned by a trigger (more less auto incrementing but it will start counting from 1 for each new string).

I can read, write, update… but not create more than one entity (the constructor sets the int part of the PK to 0, which works fine the trigger will overwrite the value but it would be best if it does not pass anything in.)

I think it would be nice if I could make the id portion read only, or … I’ve noticed from looking at the generated SQL that it is setting every value… is it possible to exclude trying to set a value if it is null? That would get the value written.

  • 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-23T16:23:02+00:00Added an answer on May 23, 2026 at 4:23 pm

    For a quick hack to resolve this, I just added a static member to the entity class which is used for the key component. I decided to go with negative numbers, just to keep clear what is an ‘insert only’ entity which should be thrown away after insert and the positive valued ones which would have been retrieved from the db. Messy but works.

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

Sidebar

Related Questions

Table: Relatives emp_id dep_id (composite primary key) We have to restrict one employee to
I have a table called table1 which has a composite primary key using 'ScreenId'
I have a table with composite primary key. I am trying to load data
We have a composite primary key for the site table defined below. Functionally, this
I have two tables one has a three column composite key. The other needs
I have two tables with a one-to-one relationship. Table1 has a composite primary key
I have a composite primary key in 1 table in oracle. I want to
Have a linking (or ref) table which has a dual primary key. Need to
I have a table with a composite Primary Key, arranged something like this: CREATE
I have a table A with a composite primary key and I have table

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.