[seam-commits] Seam SVN: r14431 - in branches/community/Seam_2_3/jboss-seam-gen/dist: src and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Mar 20 12:07:57 EDT 2012


Author: manaRH
Date: 2012-03-20 12:07:55 -0400 (Tue, 20 Mar 2012)
New Revision: 14431

Removed:
   branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/Entity.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionBean.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionJavaBean.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserAccount.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserRole.java
Modified:
   branches/community/Seam_2_3/jboss-seam-gen/dist/pojo/GetPropertyAnnotation.ftl
   branches/community/Seam_2_3/jboss-seam-gen/dist/src/Entity.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionBean.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionJavaBean.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserAccount.java
   branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserRole.java
Log:
JBSEAM-4902 replaced hibernate validator annotations by javax.validation.contraints.*

Modified: branches/community/Seam_2_3/jboss-seam-gen/dist/pojo/GetPropertyAnnotation.ftl
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/pojo/GetPropertyAnnotation.ftl	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/pojo/GetPropertyAnnotation.ftl	2012-03-20 16:07:55 UTC (rev 14431)
@@ -3,11 +3,11 @@
     @${pojo.importType("org.hibernate.annotations.Type")}(type = "yes_no")
 </#if>
 <#if !property.optional && !c2j.isPrimitive(pojo.getJavaTypeName(property, jdk5)) && (!property.equals(pojo.identifierProperty) || property.value.identifierGeneratorStrategy == "assigned")>
-    @${pojo.importType("org.hibernate.validator.NotNull")}
+    @${pojo.importType("javax.validation.constraints.NotNull")}
 </#if>
 <#if property.columnSpan==1>
 <#assign column = property.getColumnIterator().next()/>
 <#if !c2h.isManyToOne(property) && !c2h.isTemporalValue(property) && column.length!=255 && property.type.name!="character" && pojo.getJavaTypeName(property, jdk5)?lower_case!="boolean">
-    @${pojo.importType("org.hibernate.validator.Length")}(max=${column.length?c})
+    @${pojo.importType("javax.validation.constraints.Size")}(max=${column.length?c})
 </#if>
 </#if>

Modified: branches/community/Seam_2_3/jboss-seam-gen/dist/src/Entity.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src/Entity.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src/Entity.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -5,7 +5,7 @@
 import javax.persistence.Id;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Version;
-import org.hibernate.validator.Length;
+import javax.validation.constraints.Size;
 
 @Entity
 public class @entityName@ implements Serializable
@@ -37,7 +37,7 @@
         this.version = version;
     }
 
-    @Length(max = 20)
+    @Size(max = 20)
     public String getName() {
         return name;
     }

Modified: branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionBean.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionBean.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionBean.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -7,7 +7,7 @@
 import org.jboss.seam.annotations.Logger;
 import org.jboss.seam.log.Log;
 import org.jboss.seam.international.StatusMessages;
-import org.hibernate.validator.Length;
+import javax.validation.constraints.Size;
 
 @Stateful
 @Name("@componentName@")
@@ -28,7 +28,7 @@
 
     // add additional action methods
 
-    @Length(max = 10)
+    @Size(max = 10)
     public String getValue()
     {
         return value;

Modified: branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionJavaBean.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionJavaBean.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src/FormActionJavaBean.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -5,7 +5,7 @@
 import org.jboss.seam.annotations.Logger;
 import org.jboss.seam.log.Log;
 import org.jboss.seam.international.StatusMessages;
-import org.hibernate.validator.Length;
+import javax.validation.constraints.Size;
 
 @Name("@componentName@")
 public class @interfaceName@
@@ -25,7 +25,7 @@
 
     // add additional action methods
   
-    @Length(max = 10)
+    @Size(max = 10)
     public String getValue()
     {
         return value;

Modified: branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserAccount.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserAccount.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserAccount.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -13,7 +13,7 @@
 import javax.persistence.Table;
 import javax.persistence.UniqueConstraint;
 
-import org.hibernate.validator.NotNull;
+import javax.validation.constraints.NotNull;
 import org.jboss.seam.annotations.security.management.UserEnabled;
 import org.jboss.seam.annotations.security.management.UserPassword;
 import org.jboss.seam.annotations.security.management.UserPrincipal;

Modified: branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserRole.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserRole.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src/UserRole.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -11,7 +11,7 @@
 import javax.persistence.ManyToMany;
 import javax.persistence.Table;
 
-import org.hibernate.validator.NotNull;
+import javax.validation.constraints.NotNull;
 import org.jboss.seam.annotations.security.management.RoleConditional;
 import org.jboss.seam.annotations.security.management.RoleGroups;
 import org.jboss.seam.annotations.security.management.RoleName;

Deleted: branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/Entity.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/Entity.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/Entity.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -1,49 +0,0 @@
-package @modelPackage@;
-
-import java.io.Serializable;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Version;
-import javax.validation.constraints.Size;
-
- at Entity
-public class @entityName@ implements Serializable
-{
-    // 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;
-    }
-
-    private void setVersion(Integer version) {
-        this.version = version;
-    }
-
-    @Size(max = 20)
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-}

Deleted: branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionBean.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionBean.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionBean.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -1,45 +0,0 @@
-package @actionPackage@;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.international.StatusMessages;
-import javax.validation.constraints.Size;
-
- at Stateful
- at Name("@componentName@")
-public class @beanName@ implements @interfaceName@
-{
-    @Logger private Log log;
-
-    @In StatusMessages statusMessages;
-
-    private String value;
-
-    public void @methodName@()
-    {
-        // implement your business logic here
-        log.info("@componentName at .@methodName@() action called with: #{@componentName at .value}");
-        statusMessages.add("@methodName@ #{@componentName at .value}");
-    }
-
-    // add additional action methods
-
-    @Size(max = 10)
-    public String getValue()
-    {
-        return value;
-    }
-
-    public void setValue(String value)
-    {
-        this.value = value;
-    }
-
-    @Remove
-    public void destroy() {}
-
-}

Deleted: branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionJavaBean.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionJavaBean.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/FormActionJavaBean.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -1,39 +0,0 @@
-package @actionPackage@;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.international.StatusMessages;
-import javax.validation.constraints.Size;
-
- at Name("@componentName@")
-public class @interfaceName@
-{
-    @Logger private Log log;
-
-    @In StatusMessages statusMessages;
-
-    private String value;
-
-    public void @methodName@()
-    {
-        // implement your business logic here
-        log.info("@componentName at .@methodName@() action called with: #{@componentName at .value}");
-        statusMessages.add("@methodName@ #{@componentName at .value}");
-    }
-
-    // add additional action methods
-  
-    @Size(max = 10)
-    public String getValue()
-    {
-        return value;
-    }
-  
-    public void setValue(String value)
-    {
-        this.value = value;
-    }
-  
-}

Deleted: branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserAccount.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserAccount.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserAccount.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -1,83 +0,0 @@
-package @modelPackage@;
-
-import java.io.Serializable;
-import java.util.Set;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
-import javax.persistence.UniqueConstraint;
-
-import javax.validation.constraints.NotNull;
-import org.jboss.seam.annotations.security.management.UserEnabled;
-import org.jboss.seam.annotations.security.management.UserPassword;
-import org.jboss.seam.annotations.security.management.UserPrincipal;
-import org.jboss.seam.annotations.security.management.UserRoles;
-
- at Entity
- at Table(uniqueConstraints = @UniqueConstraint(columnNames = "username"), name = "user_account")
-public class UserAccount implements Serializable {
-	private static final long serialVersionUID = 6368734442192368866L;
-
-	private Long id;
-	private String username;
-	private String passwordHash;
-	private boolean enabled;
-
-	private Set<UserRole> roles;
-
-	@Id
-	@GeneratedValue
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	@NotNull
-	@UserPrincipal
-	public String getUsername() {
-		return username;
-	}
-
-	public void setUsername(String username) {
-		this.username = username;
-	}
-
-	@UserPassword(hash = "SHA")
-	@Column(name = "password_hash")
-	public String getPasswordHash() {
-		return passwordHash;
-	}
-
-	public void setPasswordHash(String passwordHash) {
-		this.passwordHash = passwordHash;
-	}
-
-	@UserEnabled
-	public boolean isEnabled() {
-		return enabled;
-	}
-
-	public void setEnabled(boolean enabled) {
-		this.enabled = enabled;
-	}
-
-	@UserRoles
-	@ManyToMany
-	@JoinTable(name = "user_account_role", joinColumns = @JoinColumn(name = "account_id"), inverseJoinColumns = @JoinColumn(name = "member_of_role"))
-	public Set<UserRole> getRoles() {
-		return roles;
-	}
-
-	public void setRoles(Set<UserRole> roles) {
-		this.roles = roles;
-	}
-}

Deleted: branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserRole.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserRole.java	2012-03-19 09:38:59 UTC (rev 14430)
+++ branches/community/Seam_2_3/jboss-seam-gen/dist/src-ee6/UserRole.java	2012-03-20 16:07:55 UTC (rev 14431)
@@ -1,69 +0,0 @@
-package @modelPackage@;
-
-import java.io.Serializable;
-import java.util.Set;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
-
-import javax.validation.constraints.NotNull;
-import org.jboss.seam.annotations.security.management.RoleConditional;
-import org.jboss.seam.annotations.security.management.RoleGroups;
-import org.jboss.seam.annotations.security.management.RoleName;
-
- at Entity
- at Table(name = "user_role")
-public class UserRole implements Serializable {
-	private static final long serialVersionUID = 9177366120789064801L;
-
-	private Long id;
-	private String name;
-	private boolean conditional;
-
-	private Set<UserRole> groups;
-
-	@Id
-	@GeneratedValue
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	@RoleName
-	@NotNull
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	@RoleGroups
-	@ManyToMany
-	@JoinTable(name = "user_role_group", joinColumns = @JoinColumn(name = "role_id"), inverseJoinColumns = @JoinColumn(name = "member_of_role"))
-	public Set<UserRole> getGroups() {
-		return groups;
-	}
-
-	public void setGroups(Set<UserRole> groups) {
-		this.groups = groups;
-	}
-
-	@RoleConditional
-	public boolean isConditional() {
-		return conditional;
-	}
-
-	public void setConditional(boolean conditional) {
-		this.conditional = conditional;
-	}
-}



More information about the seam-commits mailing list