diff options
Diffstat (limited to 'src/main/java/nu/xss/jpa/entity/AbstractEntity.java')
-rw-r--r-- | src/main/java/nu/xss/jpa/entity/AbstractEntity.java | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/src/main/java/nu/xss/jpa/entity/AbstractEntity.java b/src/main/java/nu/xss/jpa/entity/AbstractEntity.java index 5a4f468..c79c17a 100644 --- a/src/main/java/nu/xss/jpa/entity/AbstractEntity.java +++ b/src/main/java/nu/xss/jpa/entity/AbstractEntity.java @@ -1,16 +1,62 @@ +/** + * This file is part of xss-jpa. + * + * Copyright 2012 Sebastian Schmelzer + * http://xss.nu/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with library. If not, see <http://www.gnu.org/licenses/>. + * + */ package nu.xss.jpa.entity; +import java.lang.reflect.Field; + import javax.persistence.MappedSuperclass; +/** + * The Class AbstractEntity. + * + * @param <K> + * the key type + */ @MappedSuperclass public abstract class AbstractEntity<K> implements TypedEntity<K> { + /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; + /** + * Instantiates a new abstract entity. + */ public AbstractEntity() { + Field[] f = this.getClass().getFields(); + + System.out.println(f.length); + + for (int i = 0; i < f.length; i++) { + System.out.println(f[i].toGenericString()); + System.out.println(f[i].toString()); + } } - public AbstractEntity(K id) { + /** + * Instantiates a new abstract entity. + * + * @param id + * the id + */ + public AbstractEntity(final K id) { this.setId(id); } |