Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4e7ad055dd2de6ce7adb1a67a9fe29befc9ddfe6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<%@ 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 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