Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
109 lines (89 sloc) 2.45 KB
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package de.crowdcode.bitemporal.example;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.apache.commons.lang.NotImplementedException;
/**
* Person implementation.
*
* @author Lofi Dewanto
* @since 1.0.0
* @version 1.0.0
*/
@Entity
@Table(name = "person")
public class PersonImpl implements Person, Serializable {
private static final long serialVersionUID = 2909659022959145389L;
@Id
@GeneratedValue
private Long id;
@Column(name = "firstname")
private String firstname;
@Column(name = "lastname")
private String lastname;
@OneToOne(targetEntity = AddressImpl.class)
private Address address;
@Override
public String getFirstname() {
return firstname;
}
@Override
public void setFirstname(String firstname) {
this.firstname = firstname;
}
@Override
public Address getAddress() {
return this.address;
}
@Override
public void setAddress(Address address) {
this.address = address;
}
@Override
public String getLastname() {
return lastname;
}
@Override
public void setLastname(String lastname) {
this.lastname = lastname;
}
@Override
public Address address() {
return getAddress();
}
@Override
public Boolean alive() {
// Not implemented
throw new NotImplementedException("Person.alive() is not implemented!");
}
@Override
public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
}
You can’t perform that action at this time.