⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typecomment.javajet

📁 jsp开发 com.objectlearn.jdt.j2ee_3.0.1
💻 JAVAJET
字号:
<%@ jet package="com.objectlearn.gmf.templates.entity" class="TypeCommentGenerator" imports="java.util.* com.objectlearn.lomboz.xml.lomboz.DocumentRoot com.objectlearn.lomboz.xml.lomboz.EntityBean com.objectlearn.lomboz.xml.lomboz.FieldMapping  com.sun.java.xml.ns.j2ee.EntityBeanType   com.sun.java.xml.ns.j2ee.FullyQualifiedClassType"%>
<% DocumentRoot root = (DocumentRoot)argument;
   EntityBean leb = (EntityBean) root.getEjb().getEntity();
   EntityBeanType eb = leb.getEntityEjb();
   boolean isCMP = "Container".equals(eb.getPersistenceType().getValue());
   String ejbName = eb.getEjbClass().getUnqualifiedClassName();
   if(ejbName.endsWith("Bean") ){
      ejbName = ejbName.substring(0,ejbName.length()-4);
   }else if(ejbName.endsWith("Ejb") ){
      ejbName = ejbName.substring(0,ejbName.length()-3);
   }
   
   String primaryKeyType = "java.lang.String";
   int pkCount=0;
   boolean isComposite = false;
   boolean createCompositeKey = false;
   if( isCMP ) { 
       FullyQualifiedClassType pkClassType = eb.getPrimKeyClass();
       if(pkClassType != null && pkClassType.getValue() != null && pkClassType.getValue().length() > 0 )
          primaryKeyType = pkClassType.getValue();
	   Iterator fieldMappings = leb.getFieldMappings().iterator();
	   String pkType = "";
	   while(fieldMappings.hasNext()){
	      FieldMapping mapping = (FieldMapping) fieldMappings.next();
	      if(mapping.isPrimaryKey()){
	        pkType = mapping.getFieldType().getValue();
	        pkCount++;
	      }
	   }
       isComposite = pkCount > 1;
       if(!isComposite )
         primaryKeyType = pkType;
       else if(pkClassType == null || pkClassType.getValue() == null || pkClassType.getValue().length() < 1 ){
		   createCompositeKey = true;
		   primaryKeyType = eb.getEjbClass().getValue()+".PrimaryKey";
       }else if(pkClassType != null && pkClassType.getValue() != null ){
           if(primaryKeyType.equals(eb.getEjbClass().getValue()+".PrimaryKey") )
              createCompositeKey = true;
       }
   }
%>
   
/**
 *
 * <!-- begin-user-doc -->
 * You can insert your documentation for '<em><b><%=eb.getEjbClass().getUnqualifiedClassName()%></b></em>'.
 * <!-- end-user-doc -->
 *
 <!--  begin-lomboz-definition -->
 <%= root.asString() %>
 <!--  end-lomboz-definition -->
 *
 * <!-- begin-xdoclet-definition -->
<% if( isCMP ) { %>
 * @ejb.bean name="<%=ejbName%>"
 *	jndi-name="<%=eb.getEjbName()%>"
 *	type="CMP"<%if(eb.getPrimkeyField() != null ){%>
 *  primkey-field="<%= eb.getPrimkeyField().getValue() %>"<%}%> 
 *  schema="<%= eb.getAbstractSchemaName().getValue() %>" 
 *  cmp-version="<%= eb.getCmpVersion().getValue() %>"
 *  data-source="<%=leb.getDataSourceName()%>"
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.bean ejb-name="<%=ejbName%>"
 *   jndi-name="<%=eb.getEjbName()%>"
 * @jonas.jdbc-mapping  jndi-name="<%=leb.getDataSourceName()%>" jdbc-table-name="<%=leb.getTableName()%>" 
 * --
 * 
 *  @ejb.persistence 
 *   table-name="<%=leb.getTableName()%>" 
 * 
 * @ejb.finder 
 *    query="SELECT OBJECT(a) FROM <%= eb.getAbstractSchemaName().getValue() %> as a"  
 *    signature="java.util.Collection findAll()"  
 *
 * @ejb.pk class="<%= primaryKeyType %>"
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.finder-method-jdbc-mapping  method-name="findAll"
 *	jdbc-where-clause=""
 * @jonas.jdbc-mapping  jndi-name="<%=leb.getDataSourceName()%>"
 *	jdbc-table-name="<%=leb.getTableName()%>"
 * 
 *--
 * <!-- end-xdoclet-definition -->
 * @generated
 **/

<% } else { %>



/**
 * @ejb.bean name="<%=ejbName%>"
 *	jndi-name="<%=eb.getEjbName()%>"
 *	type="BMP"
 * 
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.bean ejb-name="<%=ejbName%>"
 *	jndi-name="<%=eb.getEjbName()%>"
 * 
 *--
 * <!-- end-xdoclet-defintion -->
 * @generated
 **/

<% } %>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -