1

Working on a scalable custom ID generator in JPA. The format I want to achieve is:

<first three letters of country or region> + <year> + <sequence number>

For example: USA2025001

I'm currently exploring resources on custom ID generation strategies, but I’m stuck on one part:

How can I determine the client's location (country or region) at runtime so I can extract the first three letters and use it in the ID generation logic?

1
  • 6
    "Any suggestions on how to reliably get the client’s location" You can't. You can try to base yourself on the remote IP, and then use an IP database or IP location service to get a location that is in most cases relatively accurate. So, not reliable. And then we're not even getting into VPN-like scenarios... Commented Nov 11 at 6:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.