Skip to main content
summaryrefslogblamecommitdiffstats
blob: 77cb6ffb137be6747a505d732534f1494e55f29e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                                         
                                                         






























                                                                                      
<%@ jet package="org.eclipse.jpt.ui" 
	imports="org.eclipse.jpt.ui.internal.wizards.entity.data.model.* java.util.* " 
	class="EntityTemplate" 
%>
<% CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument; 
if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") { %>package <%=model.getJavaPackageName()%>;<%}%>

<% Collection<String> imports = model.getImports(false);
for (String anImport : imports) { %>
import <%=anImport%>;
<% } %>

/**
 * Entity implementation class for Entity: <%=model.getEntityName()%>
 *
 */
public class <%=model.getClassName()%><%String superClass = model.getSuperclassName();
	if (! "".equals(superClass)) {%> extends <%=superClass%><%}%><%
	List<String> interfaces = model.getInterfaces(); 
	if (interfaces.size()>0) {%> implements <% }
	for (int i=0; i<interfaces.size(); i++) {
		String INTERFACE = (String) interfaces.get(i);
		if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {

	<% List<EntityRow> fields = model.getEntityFields(); 
	for (EntityRow entity : fields) {     
	%> 
	private <%=entity.getType()%> <%=entity.getName()%>;<%}%>
	private static final long serialVersionUID = 1L;	
	public <%=model.getClassName()%>() {
		super();
	} 
	<%
	fields = model.getEntityFields();
	if (fields != null) for (int i=0; i<fields.size(); i++) {
		EntityRow field = (EntityRow) fields.get(i);
		String TYPE = field.getType();
		String NAME = field.getName();
		String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
	%>   
	public <%=TYPE%> get<%=METHOD%>() {
 		return this.<%=NAME%>;
	}

	public void set<%=METHOD%>(<%=TYPE%> <%=NAME%>) {
		this.<%=NAME%> = <%=NAME%>;
	}
	<%}%>
   
}

Back to the top