Author: shane.bryzak(a)jboss.com
Date: 2008-04-13 08:51:14 -0400 (Sun, 13 Apr 2008)
New Revision: 7917
Modified:
trunk/seam-gen/src/Action.java
trunk/seam-gen/src/ActionBean.java
trunk/seam-gen/src/ActionJavaBean.java
trunk/seam-gen/src/Authenticator.java
trunk/seam-gen/src/Conversation.java
trunk/seam-gen/src/ConversationBean.java
trunk/seam-gen/src/ConversationJavaBean.java
trunk/seam-gen/src/Entity.java
trunk/seam-gen/src/EntityHome.java
trunk/seam-gen/src/EntityHome.java.ftl
trunk/seam-gen/src/EntityList.java
trunk/seam-gen/src/EntityList.java.ftl
trunk/seam-gen/src/FormAction.java
trunk/seam-gen/src/FormActionBean.java
trunk/seam-gen/src/FormActionJavaBean.java
trunk/seam-gen/src/Query.java
Log:
JBSEAM-2160
Modified: trunk/seam-gen/src/Action.java
===================================================================
--- trunk/seam-gen/src/Action.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/Action.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -3,10 +3,10 @@
import javax.ejb.Local;
@Local
-public interface @interfaceName@ {
-
- //seam-gen method
- public void @methodName@();
-
+public interface @interfaceName@ {
+
+ //seam-gen method
+ public void @methodName@();
+
//add additional interface methods here
}
\ No newline at end of file
Modified: trunk/seam-gen/src/ActionBean.java
===================================================================
--- trunk/seam-gen/src/ActionBean.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/ActionBean.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -10,18 +10,18 @@
@Stateless
@Name("@componentName@")
public class @beanName@ implements @interfaceName@ {
-
+
@Logger private Log log;
-
+
@In FacesMessages facesMessages;
-
+
public void @methodName@()
{
//implement your business logic here
log.info("@componentName@.@methodName(a)() action called");
facesMessages.add("@methodName@");
}
-
+
//add additional action methods
-
+
}
Modified: trunk/seam-gen/src/ActionJavaBean.java
===================================================================
--- trunk/seam-gen/src/ActionJavaBean.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/ActionJavaBean.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -8,18 +8,18 @@
@Name("@componentName@")
public class @interfaceName@ {
-
+
@Logger private Log log;
-
+
@In FacesMessages facesMessages;
-
+
public void @methodName@()
{
//implement your business logic here
log.info("@componentName@.@methodName(a)() action called");
facesMessages.add("@methodName@");
}
-
+
//add additional action methods
-
+
}
Modified: trunk/seam-gen/src/Authenticator.java
===================================================================
--- trunk/seam-gen/src/Authenticator.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/Authenticator.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -11,9 +11,9 @@
public class Authenticator
{
@Logger Log log;
-
+
@In Identity identity;
-
+
public boolean authenticate()
{
log.info("authenticating #0", identity.getUsername());
Modified: trunk/seam-gen/src/Conversation.java
===================================================================
--- trunk/seam-gen/src/Conversation.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/Conversation.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -3,14 +3,14 @@
import javax.ejb.Local;
@Local
-public interface @interfaceName@ {
-
- //seam-gen methods
- public String begin();
- public String increment();
- public String end();
- public int getValue();
- public void destroy();
-
- //add additional interface methods here
+public interface @interfaceName@ {
+
+ //seam-gen methods
+ public String begin();
+ public String increment();
+ public String end();
+ public int getValue();
+ public void destroy();
+
+ //add additional interface methods here
}
\ No newline at end of file
Modified: trunk/seam-gen/src/ConversationBean.java
===================================================================
--- trunk/seam-gen/src/ConversationBean.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/ConversationBean.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -12,41 +12,41 @@
@Stateful
@Name("@componentName@")
public class @beanName@ implements @interfaceName@ {
-
+
@Logger private Log log;
-
+
private int value;
-
- @Begin
- public String begin()
- {
- //implement your begin conversation business logic
- log.info("beginning conversation");
- return "success";
- }
-
- public String increment()
- {
- log.info("incrementing");
- value++;
- return "success";
- }
-
- //add additional action methods that participate in this conversation
-
- @End
- public String end()
- {
+
+ @Begin
+ public String begin()
+ {
+ //implement your begin conversation business logic
+ log.info("beginning conversation");
+ return "success";
+ }
+
+ public String increment()
+ {
+ log.info("incrementing");
+ value++;
+ return "success";
+ }
+
+ //add additional action methods that participate in this conversation
+
+ @End
+ public String end()
+ {
//implement your end conversation business logic
log.info("ending conversation");
- return "home";
- }
-
- public int getValue()
- {
- return value;
- }
-
- @Destroy @Remove
- public void destroy() {}
+ return "home";
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
}
Modified: trunk/seam-gen/src/ConversationJavaBean.java
===================================================================
--- trunk/seam-gen/src/ConversationJavaBean.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/ConversationJavaBean.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -12,39 +12,39 @@
@Scope(CONVERSATION)
@Name("@componentName@")
public class @interfaceName@ {
-
+
@Logger private Log log;
-
+
private int value;
-
- @Begin
- public String begin()
- {
- //implement your begin conversation business logic
- log.info("beginning conversation");
- return "success";
- }
-
- public String increment()
- {
- log.info("incrementing");
- value++;
- return "success";
- }
-
- //add additional action methods that participate in this conversation
-
- @End
- public String end()
- {
+
+ @Begin
+ public String begin()
+ {
+ //implement your begin conversation business logic
+ log.info("beginning conversation");
+ return "success";
+ }
+
+ public String increment()
+ {
+ log.info("incrementing");
+ value++;
+ return "success";
+ }
+
+ //add additional action methods that participate in this conversation
+
+ @End
+ public String end()
+ {
//implement your end conversation business logic
log.info("ending conversation");
- return "home";
- }
-
- public int getValue()
- {
- return value;
- }
-
+ return "home";
+ }
+
+ public int getValue()
+ {
+ return value;
+ }
+
}
Modified: trunk/seam-gen/src/Entity.java
===================================================================
--- trunk/seam-gen/src/Entity.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/Entity.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -9,40 +9,40 @@
@Entity
public class @entityName@ implements Serializable {
-
- //seam-gen attributes (you should probably edit these)
- private Long id;
- private Integer version;
- private String name;
-
+
+ //seam-gen attributes (you should probably edit these)
+ private Long id;
+ private Integer version;
+ private String name;
+
//add additional entity attributes
-
- //seam-gen attribute getters/setters with annotations (you probably should edit)
-
- @Id @GeneratedValue
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
-
- @Version
- public Integer getVersion() {
- return version;
- }
+ //seam-gen attribute getters/setters with annotations (you probably should edit)
- private void setVersion(Integer version) {
- this.version = version;
- }
-
- @Length(max=20)
- public String getName() {
- return name;
- }
+ @Id @GeneratedValue
+ public Long getId() {
+ return id;
+ }
- public void setName(String name) {
- this.name = name;
- }
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Version
+ public Integer getVersion() {
+ return version;
+ }
+
+ private void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ @Length(max=20)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
}
Modified: trunk/seam-gen/src/EntityHome.java
===================================================================
--- trunk/seam-gen/src/EntityHome.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/EntityHome.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -11,12 +11,12 @@
public class @entityName@Home extends EntityHome<@entityName@>
{
- @RequestParameter
+ @RequestParameter
Long @componentName@Id;
-
+
@Override
- public Object getId()
- {
+ public Object getId()
+ {
if (@componentName@Id==null)
{
return super.getId();
@@ -26,10 +26,10 @@
return @componentName@Id;
}
}
-
+
@Override @Begin
public void create() {
super.create();
}
-
+
}
Modified: trunk/seam-gen/src/EntityHome.java.ftl
===================================================================
--- trunk/seam-gen/src/EntityHome.java.ftl 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/EntityHome.java.ftl 2008-04-13 12:51:14 UTC (rev 7917)
@@ -37,7 +37,7 @@
{
set${idName}( new ${entityName}Id() );
}
-
+
@Override
public boolean isIdDefined()
{
@@ -64,7 +64,7 @@
</#if>
return ${componentName};
}
-
+
public void wire()
{
<#foreach property in pojo.allPropertiesIterator>
@@ -82,7 +82,7 @@
</#if>
</#foreach>
}
-
+
public boolean isWired()
{
<#foreach property in pojo.allPropertiesIterator>
@@ -93,18 +93,18 @@
</#foreach>
return true;
}
-
+
public ${entityName} getDefinedInstance()
{
return isIdDefined() ? getInstance() : null;
}
-
+
<#foreach property in pojo.allPropertiesIterator>
<#assign getter = pojo.getGetterSignature(property)>
<#if c2h.isOneToManyCollection(property)>
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
public ${pojo.importType("java.util.List")}<${childPojo.shortName}>
${getter}() {
- return getInstance() == null ?
+ return getInstance() == null ?
null : new
${pojo.importType("java.util.ArrayList")}<${childPojo.shortName}>(
getInstance().${getter}() );
}
</#if>
Modified: trunk/seam-gen/src/EntityList.java
===================================================================
--- trunk/seam-gen/src/EntityList.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/EntityList.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -7,8 +7,8 @@
public class @entityName@List extends EntityQuery
{
@Override
- public String getEjbql()
- {
+ public String getEjbql()
+ {
return "select @componentName@ from @entityName@ @componentName@";
}
}
Modified: trunk/seam-gen/src/EntityList.java.ftl
===================================================================
--- trunk/seam-gen/src/EntityList.java.ftl 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/EntityList.java.ftl 2008-04-13 12:51:14 UTC (rev 7917)
@@ -47,22 +47,22 @@
</#if>
@Override
- public String getEjbql()
- {
+ public String getEjbql()
+ {
return "select ${componentName} from ${entityName} ${componentName}";
}
-
+
@Override
public Integer getMaxResults()
{
- return 25;
+ return 25;
}
-
+
public ${entityName} get${entityName}()
{
return ${componentName};
}
-
+
@Override
public List<String> getRestrictions()
{
Modified: trunk/seam-gen/src/FormAction.java
===================================================================
--- trunk/seam-gen/src/FormAction.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/FormAction.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -3,12 +3,12 @@
import javax.ejb.Local;
@Local
-public interface @interfaceName@ {
-
- public void @methodName@();
- public String getValue();
- public void setValue(String value);
- public void destroy();
-
+public interface @interfaceName@ {
+
+ public void @methodName@();
+ public String getValue();
+ public void setValue(String value);
+ public void destroy();
+
//add additional interface methods here
}
\ No newline at end of file
Modified: trunk/seam-gen/src/FormActionBean.java
===================================================================
--- trunk/seam-gen/src/FormActionBean.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/FormActionBean.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -10,25 +10,25 @@
import org.jboss.seam.faces.FacesMessages;
import org.hibernate.validator.Length;
-@Stateful
+@Stateful
@Name("@componentName@")
public class @beanName@ implements @interfaceName@ {
@Logger private Log log;
-
+
@In FacesMessages facesMessages;
-
+
private String value;
-
+
public void @methodName@()
- {
+ {
//implement your business logic here
log.info("@componentName@.@methodName(a)() action called with:
#{@componentName@.value}");
facesMessages.add("@methodName@ #{@componentName@.value}");
- }
-
- //add additional action methods
-
+ }
+
+ //add additional action methods
+
@Length(max=10)
public String getValue()
{
@@ -40,7 +40,7 @@
this.value = value;
}
- @Destroy @Remove
+ @Destroy @Remove
public void destroy() {}
-
+
}
Modified: trunk/seam-gen/src/FormActionJavaBean.java
===================================================================
--- trunk/seam-gen/src/FormActionJavaBean.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/FormActionJavaBean.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -11,29 +11,29 @@
public class @interfaceName@ {
@Logger private Log log;
-
+
@In FacesMessages facesMessages;
-
+
private String value;
-
- public void @methodName@()
- {
- //implement your business logic here
- log.info("@componentName@.@methodName(a)() action called with:
#{@componentName@.value}");
- facesMessages.add("@methodName@ #{@componentName@.value}");
- }
-
- //add additional action methods
-
- @Length(max=10)
- public String getValue()
- {
- return value;
- }
-
- public void setValue(String value)
- {
- this.value = value;
- }
-
+
+ public void @methodName@()
+ {
+ //implement your business logic here
+ log.info("@componentName@.@methodName(a)() action called with:
#{@componentName@.value}");
+ facesMessages.add("@methodName@ #{@componentName@.value}");
+ }
+
+ //add additional action methods
+
+ @Length(max=10)
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
}
Modified: trunk/seam-gen/src/Query.java
===================================================================
--- trunk/seam-gen/src/Query.java 2008-04-13 12:47:56 UTC (rev 7916)
+++ trunk/seam-gen/src/Query.java 2008-04-13 12:51:14 UTC (rev 7917)
@@ -8,8 +8,8 @@
public class @beanName@ extends EntityQuery
{
@Override
- public String getEjbql()
- {
+ public String getEjbql()
+ {
return "@query@";
}
@@ -18,7 +18,7 @@
public void setFirstResult(Integer firstResult) {
super.setFirstResult(firstResult);
}
-
+
@Override
public Integer getMaxResults() {
return 25;