Damn, this is harder then I thought.
Some people have camel-case names like McDonald
or O'Ferncher
, and some do not have double-barrelled name, but hyphenated name like Bowes-Lyon
or just given name, like Honovi Hohnihhohkaiyohos
( Strong High Backed Wolf ). In some culture spaces like:
In some places you have gender inequality and to formally address a person you need to use prefix, like: Sir
(where gender can be male, female and in-between). And yes, prefix changes depending on the persons age.
Like this is not enough - people can and will get married (this occurs pretty often)(thy might do this multiple times), and it is a default custom for at least one partner to change their family name. In most places people can change their name or at least given name.
This is not important if you want to answer the question, just giving a hint what I'm trying to do.
Tables where I want to store the names are in xml and appengine datastore with twig object store interface (I use twig among other things, for it enables me to compile schema). Data itself can come form various places and probably there exists a case where old name is used (so - storing multiple names).
My best guess is:
@XmlAttribute @Key protected Long id;
@XmlElement(required = true) final protected List<String> lastName;
@XmlElement(required = false) protected String middleName;
@XmlElement(required = true) final protected List<String> firstName;
@XmlElement(required = true) protected Boolean isMale;
@XmlElement(required = true) protected Date birthday;
//+locale for naming?
Writing function or preconditions for compareTo
method just makes My day ... I'm seriously considering 0 fault tolerance. Yes, meaning existence or lack of apostrophes, whitespace and other symbols or case difference can yield to different results. (And for cynical bastards - this is not homework.)
The question was: How to store persons name in a record table?
If you are looking for a simple, universal solution, I think you will find that there is none. Read this blog posting, and weep.
And when you've finished crying, take a look at this document, which attempts to model names for a US American audience. Obviously it makes a lot of simplifying assumptions, which are probably invalid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With