Creating a table with Hibernate
<p>On the beginning i would like to inform that i'm new in this king of stuff.
I got a problem with creating proper sql tables for my spring MVC application. To manage my database I'm using Hibernate. My application got two types of user:
* primary - name,surname,email,
* secondary - which in my mind should extend "primary" because it got the same attributes plus additional which belong only to "secondary"</p>

<p>So far i create two models with users:</p>

<p>User</p>

<hr>

<pre><code>    @Entity
    @Table(name = "users", catalog = "findbabysister")
    public class User {

        @Id
        @Column(name = "username", unique=true,
        nullable = false, length = 45)
        private String email;

        @Column(name = "password")
        private String password;

        private String passwordConfirm;

        @Column(name = "enabled")
        private boolean enabled = true;

        @Column(name = "firstName")
        private String firstName;

        @Column(name = "lastName")
        private String lastName;

        @Column(name = "sex")
        private boolean sex;

        @Column(name = "zipCode")
        private String zipCode;

        private Set&lt;UserRole&gt; userRole = new HashSet&lt;UserRole&gt;(0);
}
</code></pre>

<p>and UserNanny</p>

<hr>

<pre><code>@Entity
@Table(name = "usersGuardian", catalog = "findbabysister")
public class UserNanny extends User{

    @Column(name = "typOfJob")
    private String typOfJob;
    @Column(name = "whatUwannaDo")
    private String whatUwannaDo;

    public String getTypOfJob() {
        return typOfJob;
    }
    public void setTypOfJob(String typOfJob) {
        this.typOfJob = typOfJob;
    }
    public String getWhatUwannaDo() {
        return whatUwannaDo;
    }
    public void setWhatUwannaDo(String whatUwannaDo) {
        this.whatUwannaDo = whatUwannaDo;
    }
}
</code></pre>

<p>Now I'm wondering how to create tables properly. I know that i can use Single Table Strategy but it's not a professional approach to this task. My idea was creating two tables like this:</p>

<p>"Users":
* email Pk
* username
* password
* firstname
* lastname
* sex
* zipcode</p>

<p>"UsersGuardian":
* email Pk
* username
* password
* firstname
* lastname
* sex
* zipcode
* typeOfJob
* whatUWannaDo</p>

<p>Please let my know if that is a good solution in my case. </p>

<p>Thanks in advance for any information :)</p>