001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.camel.example.etl; 018 019 import javax.persistence.Entity; 020 import javax.persistence.GeneratedValue; 021 import javax.persistence.Id; 022 import javax.xml.bind.annotation.XmlAccessType; 023 import javax.xml.bind.annotation.XmlAccessorType; 024 import javax.xml.bind.annotation.XmlAttribute; 025 import javax.xml.bind.annotation.XmlRootElement; 026 027 /** 028 * An example entity bean which can be marshalled to/from XML 029 * 030 * @version $Revision: 1.1 $ 031 */ 032 @Entity(name = "Customer") 033 @XmlRootElement(name = "customer") 034 @XmlAccessorType(XmlAccessType.FIELD) 035 public class CustomerEntity { 036 @XmlAttribute 037 private Long id; 038 private String userName; 039 private String firstName; 040 private String surname; 041 private String street; 042 private String city; 043 private String zip; 044 private String phone; 045 046 public String toString() { 047 return "Customer[userName: " + userName + " firstName: " + firstName + " surname: " + surname + "]"; 048 } 049 050 @Id 051 @GeneratedValue 052 public Long getId() { 053 return id; 054 } 055 056 public void setId(Long id) { 057 this.id = id; 058 } 059 060 public String getCity() { 061 return city; 062 } 063 064 public void setCity(String city) { 065 this.city = city; 066 } 067 068 public String getFirstName() { 069 return firstName; 070 } 071 072 public void setFirstName(String firstName) { 073 this.firstName = firstName; 074 } 075 076 public String getPhone() { 077 return phone; 078 } 079 080 public void setPhone(String phone) { 081 this.phone = phone; 082 } 083 084 public String getStreet() { 085 return street; 086 } 087 088 public void setStreet(String street) { 089 this.street = street; 090 } 091 092 public String getSurname() { 093 return surname; 094 } 095 096 public void setSurname(String surname) { 097 this.surname = surname; 098 } 099 100 public String getUserName() { 101 return userName; 102 } 103 104 public void setUserName(String userName) { 105 this.userName = userName; 106 } 107 108 public String getZip() { 109 return zip; 110 } 111 112 public void setZip(String zip) { 113 this.zip = zip; 114 } 115 }