#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.component;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import de.dfki.asr.compass.${artifactId}.SceneNodeComponent;
import de.dfki.asr.compass.${artifactId}.components.annotations.CompassComponent;
import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * The Entity (database storage) class for the sample component.
 * Each SceneNodeComponent you develop needs to have its data stored using JPA,
 * which is why it (at the very minimum) needs the @Entity, as well as the
 * @JsonSubTypes annotation. The JAXB annotations are used mainly for loading
 * sample data at startup, see COMPASS' core "database-initialization" module.
 * Sometimes, you need more jackson annotations (@Json...) to customize serialization.
 * If you need classes to support this, e.g. @JsonSerialize(using=Custom.class),
 * these are better suited to live in the REST module. See the COMPASS core
 * REST module on how to perform this (look for "Mixin").
 */
@Entity
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@CompassComponent(ui = "/WEB-INF/components/samplecomponent.xhtml")
@JsonSubTypes.Type(value = SampleSceneNodeComponent.class)
public class SampleSceneNodeComponent extends SceneNodeComponent {

	@XmlElement
	private String sampleData;

	public String getSampleData() {
		return sampleData;
	}

	public void setSampleData(String sampleData) {
		this.sampleData = sampleData;
	}

}

@@ -1660,10 +1660,979 @@
 ta;%0A%09%7D%0A%0A
+%09/*%0A%09 * When your SceneNodeComponent becomes more complex (e.g. by referencing%0A%09 * other entity classes), you need to take care of some peculiarities.%0A%09 * To support copying of SceneNode hierarchies, COMPASS performs a%0A%09 * serialization/deserialization cycle on the whole hierarchy. To save%0A%09 * that copy as new entities, the @Id columns need to be reset to 0.%0A%09 * Therefore, you should implement clearIdsAfterDeepCopy(), and especially%0A%09 * propagate that call to any child entities.%0A%09 */%0A%09@Override%0A%09public void clearIdsAfterDeepCopy() %7B%0A%09%09super.clearIdsAfterDeepCopy();%0A%09%7D%0A%0A%09/*%0A%09 * On some occasions, COMPASS needs to load a complete hierarchy from the%0A%09 * database. If your SceneNodeComponent has a lazy-loaded Collecion field,%0A%09 * You should implement forceEagerFetch(), in which you should iterate%0A%09 * over you Collection field(s) and also call forceEagerFetch on child%0A%09 * entities.%0A%09 */%0A%09@Override%0A%09public void forceEagerFetch() %7B%0A%09%09super.forceEagerFetch();%0A%09%7D%0A%0A
 %7D%0A

add Documentation for forceEagerFetch and clearIdsAfterDeppCopy