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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:07:13+00:00 2026-05-23T13:07:13+00:00

I am thinking about the best way to model city, region, postcodes for usage

  • 0

I am thinking about the “best” way to model city, region, postcodes for usage in different countries. (Application should be used in different languages)

My first guess is:

class City {
    String name
    String region
    static hasMany = [postcodes:PostCode]
    static belongsTo = [region:Region]
    static constraints = {
        name size:2..100
        region nullable:true
    }
}

Now the questions are:

  • Can one city belong to more than one region? (States/Bundesländer/Communities/…)
  • As all of this is final, no new cities, regions or postCodes I thought about not using the database and put it into enums!?
  • As I want to separate data for different countries I have to add this to a city. I took a look at multiTenant-plugin but I am not quite sure if this isn’t to much!?

Probably someone has dealt with this before and can share some insights.

Thanks a lot
Sebastian

  • 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-23T13:07:14+00:00Added an answer on May 23, 2026 at 1:07 pm

    Can one city belong to more than one
    region?
    (States/Bundesländer/Communities/…)

    That depends on you. You haven’t explicitly stated what a region is. A region could be the suburbs of x city or Western Europe depending on how you define it. If a region isn’t defined by state boundaries, then it’s possible that a city can belong to more than one region. For example, “Paris” could be contained in the “France” region as well as the “Western Europe” region.

    A simple solution would be to limit regions to state boundaries, but that might not be a good solution depending on what you need the data for. You could create an array of strings to store your regions, but it’s difficult to pick an alternative if you don’t say what the data is needed for. Based off of what you’ve written, I think a separate “String country” would be appropriate since you can then sort by country, and your regions can remain as they are.

    As all of this is final, no new
    cities, regions or postCodes I thought
    about not using the database and put
    it into enums!?

    You could do that, but it’s much easier to manage in a DB.

    As I want to separate data for
    different countries I have to add this
    to a city. I took a look at
    multiTenant-plugin but I am not quite
    sure if this isn’t to much!?

    I’m haven’t used the plugin so I can’t help you there, but if you just want to separate data by country, then adding a country field and sorting would be pretty straightforward.

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

Sidebar

Related Questions

Just thinking about the best way to build an Order form that would (from
I have been thinking about the best way to store product / customer /
I've developed a desktop Swing app and I'm thinking about the best way to
Without thinking about it at all I just want to say I should allow
Been thinking about this for hours now. Im building a simple slideshow application, where
I am looking for the best way to model a scenario in C#, which
I am trying to figure out the best way to model a spreadsheet (from
Since I learned about RDBMS, I started thinking in the relational model and less
Thinking about getting into .net technology project management I've had plenty of experience with
Thinking about a Windows-hosted build process that will periodically drop files to disk to

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.