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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:26:25+00:00 2026-06-01T19:26:25+00:00

Is there a canonical way to represent a dictionary in – maintained through java

  • 0

Is there a “canonical” way to represent a dictionary in – maintained through java persistence – database?

Lets say I have a table of people and there is a column “profession”.

Set of professions is restricted but can be extended. Some professions have some special meanings for a system, like a military, or a doctor.

  1. I can use enum for professions and store string (name() method) values in database as it shown here. It is simple and readable.
  2. In database I can have a dictionary table ‘profession’ with professions (id, name_of_profession), and table ‘people’ which has foreign key (id_profession) from table ‘profession’. Than enum will have an Integer id value that is mapped to id column in ‘profession’ table.

First solution is short and easy. But in that case, database without application has no integrity. Is the second “legacy” way inappropriate?

  • 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-01T19:26:26+00:00Added an answer on June 1, 2026 at 7:26 pm

    I think you have identified the pros and cons of the two approaches. It is really up to you to decide which is better … for your specific application.

    Or to put it another way, “best practice” depends on your application’s real requirements.

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

Sidebar

Related Questions

Is there a canonical best-way-to-do-this for the following situation? I have a block of
is there a canonical way to partition a table by referenced data to another
Is there a canonical way to randomize an array in Objective-C?
Is there a canonical way to test to see if the process has administrative
In Rails, is there a canonical way of giving different views of the same
In Java, is there a way (at runtime) to obtain the bytecode which defined
Is there any canonical way to measure the performance of a CATiledLayer on iOS?
Mathematics naive question: What is the canonical way to represent 14+1i? 14+i1 or 14+i
I'm wondering if there is a more canonical way to do this in ruby
Is there a canonical way of doing that? I've been using head -n |

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.