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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:38:49+00:00 2026-05-22T23:38:49+00:00

If I have three model classes – Taxpayer , Criminal and Patient – can

  • 0

If I have three model classes – Taxpayer, Criminal and Patient – can I use socialSecurityNumber as the Key ID for all three or do I need to make it unique even across model classes.

In other words, should it be like this:

String socialSecurityNumber = "123-45-6789";
Long now = new Long(System.currentTimeMillis()); // use time to create uniqueness
String name = now.toString() + "-" + socialSecurityNumber;
Key key = KeyFactory.createKey(getClass().getSimpleName(), name);

or this:

String socialSecurityNumber = "123-45-6789";
Key key = KeyFactory.createKey(getClass().getSimpleName(), socialSecurityNumber);
  • 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-22T23:38:50+00:00Added an answer on May 22, 2026 at 11:38 pm

    Yes. The key name forms only part of the key, along with the app ID, entity kind, and any ancestor keys, so it’s fine to use the same key name in different models.

    Be aware, however, that a social security number makes a poor primary key for several reasons:

    • You probably shouldn’t be collecting it from your users in the first place, and they may have the right to refuse to give it to you.
    • Not everyone has an SSN – in particular, people who aren’t US citizens, and even some US citizens too.
    • They’re not unique: old SSN numbers get recycled. In the early days of the SSN system, some duplicates were issued, too.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three model classes that look as below: class Model(models.Model): model = models.CharField(max_length=20,
Lets say I have three django model classes - lets call them A, B
i have three tables and 2 JPA model classes: Unit ------------ id [PK] -
I have three different abstract model base classes . . . I'd like to
I have a model composed of three classes: A, B and C. A has
Have the following XML model <A></A> <B></B> <C></C> <D></D> Also have three classes class
I have a model with three classes: PendingAuthorisation , Director , and Member .
In my model I have three complex scopes returning the Discount object arrays. Each
Let's assume I have a model called product. Let's assume that product has three
I have three classes called Broker , Instrument and BrokerInstrument . using Iesi.Collections.Generic; public

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.