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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:27:12+00:00 2026-06-06T21:27:12+00:00

I have many entities of one type which have Key with auto-generated Long ID

  • 0

I have many entities of one type which have Key with auto-generated Long ID (e.g. Person(1234)), but now I need to change those keys to have String name instead (e.g. Person(“username”)).

How should I achieve this?

  • 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-06T21:27:14+00:00Added an answer on June 6, 2026 at 9:27 pm

    You have two options:

    1. Add a username attribute to the entity and get (using query) the entity by user name.
    2. When creating the Person entity provide a key_name (Person(key_name=username, …) ), but you will need to migrate all the existing Person entities by recreating them.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have many relations of this type, but I can't see why this one
I have a case where i have three entities with one-to-many and one-to-many relationships:
I have 2 NHibernate entities (tables) that are in a one to many relationship.
Preface: I have two entities defined as a one-to-many relationship: A <<-------> B. B's
I have two entities, a User and Role with a one-to-many relationship from user
I have 2 Entities, related by a many-to-many relationship. Thing<<->>Tag There is one NSArrayController
i have two Entities, Parent and Child, that are linked through a bidirectional one-to-many
I have two related one to many entities Race and Cars (on race contains
Auto generating entities from a legacy database. Many of the tables have non standard
I have two Doctrine entities that have a one-to-many relationship, like this: License class

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.