Hi Matt,

My Person.class is below and I use Long as id:

package org.appfuse.model;

import org.appfuse.model.BaseObject;

import javax.persistence.*;

@Entity @Table(name="person")
public class Person extends BaseObject {
    private Long id;
    private String firstName;
    private String lastName;

    // START SNIPPET: id
    @Id @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }
    // END SNIPET: id

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="first_name", length=50)
    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    @Column(name="last_name", length=50) 
    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }


    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Person person = (Person) o;

        if (firstName != null ? !firstName.equals(person.firstName) :
person.firstName != null) return false;
        if (lastName != null ? !lastName.equals(person.lastName) :
person.lastName != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (firstName != null ? firstName.hashCode() : 0);
        result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
        return result;
    }

    public String toString() {
        return "Person{" +
                "id=" + id +
                ", firstName='" + firstName + '\'' +
                ", lastName='" + lastName + '\'' +
                '}';
    }
}

-- 
View this message in context: 
http://n4.nabble.com/No-need-to-register-personDao-in-applicationContext-dao-xml-anymore-tp1744994p1745459.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to