Here is my entity:

package org.hk.crossroads.shippingapp.model;
// Generated 15/11/2007 14:57:06 by Hibernate Tools 3.2.0.b10

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * SApplication generated by hbm2java
 */
@Entity
@Table(name = "s_application", catalog = "shipping_nh")
public class SApplication implements java.io.Serializable {

        private Integer applicationId;
        private String shipmentCode;
        private String region;
        private String country;
        private String province;
        private String organisation;
        private String contactPerson;
        private String projectType;
        private String projectBrief;
        private String contentsRequired;
        private String stateOfRegistration;
        private String oldForms;
        private String statusOfApplication;
        private String referees;
        private String outcomeOfApplication;
        private String notes;
        private String reviewFeedback;
        private String status;
        private Date dateEntered;
        private String enteredByUser;
        private String updatedByUser;
        private Date dateLastUpdated;
        private Set SCorrespondences = new HashSet(
                        0);
        

        public SApplication() {
        }

        public SApplication(String shipmentCode, Date dateEntered,
                        Date dateLastUpdated) {
                this.shipmentCode = shipmentCode;
                this.dateEntered = dateEntered;
                this.dateLastUpdated = dateLastUpdated;
        }
        public SApplication(String shipmentCode, String region, String country,
                        String province, String organisation, String 
contactPerson,
                        String projectType, String projectBrief, String 
contentsRequired,
                        String stateOfRegistration, String oldForms,
                        String statusOfApplication, String referees,
                        String outcomeOfApplication, String notes, String 
reviewFeedback,
                        String status, Date dateEntered, String enteredByUser,
                        String updatedByUser, Date dateLastUpdated,
                        Set SCorrespondences,
                        Set SCorrespondences_1) {
                this.shipmentCode = shipmentCode;
                this.region = region;
                this.country = country;
                this.province = province;
                this.organisation = organisation;
                this.contactPerson = contactPerson;
                this.projectType = projectType;
                this.projectBrief = projectBrief;
                this.contentsRequired = contentsRequired;
                this.stateOfRegistration = stateOfRegistration;
                this.oldForms = oldForms;
                this.statusOfApplication = statusOfApplication;
                this.referees = referees;
                this.outcomeOfApplication = outcomeOfApplication;
                this.notes = notes;
                this.reviewFeedback = reviewFeedback;
                this.status = status;
                this.dateEntered = dateEntered;
                this.enteredByUser = enteredByUser;
                this.updatedByUser = updatedByUser;
                this.dateLastUpdated = dateLastUpdated;
                this.SCorrespondences = SCorrespondences;
                this.SCorrespondences_1 = SCorrespondences_1;
        }

        @Id
        @GeneratedValue(strategy = IDENTITY)
        @Column(name = "Application_ID", unique = true, nullable = false)
        public Integer getApplicationId() {
                return this.applicationId;
        }

        public void setApplicationId(Integer applicationId) {
                this.applicationId = applicationId;
        }

        @Column(name = "Shipment_Code", nullable = false, length = 10)
        @NotNull
        @Length(max = 10)
        public String getShipmentCode() {
                return this.shipmentCode;
        }

        public void setShipmentCode(String shipmentCode) {
                this.shipmentCode = shipmentCode;
        }

        @Column(name = "Region", length = 25)
        @Length(max = 25)
        public String getRegion() {
                return this.region;
        }

        public void setRegion(String region) {
                this.region = region;
        }

        @Column(name = "Country", length = 100)
        @Length(max = 100)
        public String getCountry() {
                return this.country;
        }

        public void setCountry(String country) {
                this.country = country;
        }

        @Column(name = "Province", length = 100)
        @Length(max = 100)
        public String getProvince() {
                return this.province;
        }

        public void setProvince(String province) {
                this.province = province;
        }

        @Column(name = "Organisation")
        public String getOrganisation() {
                return this.organisation;
        }

        public void setOrganisation(String organisation) {
                this.organisation = organisation;
        }

        @Column(name = "Contact_Person")
        public String getContactPerson() {
                return this.contactPerson;
        }

        public void setContactPerson(String contactPerson) {
                this.contactPerson = contactPerson;
        }

        @Column(name = "Project_Type", length = 50)
        @Length(max = 50)
        public String getProjectType() {
                return this.projectType;
        }

        public void setProjectType(String projectType) {
                this.projectType = projectType;
        }

        @Column(name = "Project_Brief", length=2147483647)
        public String getProjectBrief() {
                return this.projectBrief;
        }

        public void setProjectBrief(String projectBrief) {
                this.projectBrief = projectBrief;
        }

        @Column(name = "Contents_Required", length=2147483647)
        public String getContentsRequired() {
                return this.contentsRequired;
        }

        public void setContentsRequired(String contentsRequired) {
                this.contentsRequired = contentsRequired;
        }

        @Column(name = "State_Of_Registration")
        public String getStateOfRegistration() {
                return this.stateOfRegistration;
        }

        public void setStateOfRegistration(String stateOfRegistration) {
                this.stateOfRegistration = stateOfRegistration;
        }

        @Column(name = "Old_Forms")
        public String getOldForms() {
                return this.oldForms;
        }

        public void setOldForms(String oldForms) {
                this.oldForms = oldForms;
        }

        @Column(name = "Status_Of_Application", length = 50)
        @Length(max = 50)
        public String getStatusOfApplication() {
                return this.statusOfApplication;
        }

        public void setStatusOfApplication(String statusOfApplication) {
                this.statusOfApplication = statusOfApplication;
        }

        @Column(name = "Referees", length=2147483647)
        public String getReferees() {
                return this.referees;
        }

        public void setReferees(String referees) {
                this.referees = referees;
        }

        @Column(name = "Outcome_Of_Application")
        public String getOutcomeOfApplication() {
                return this.outcomeOfApplication;
        }

        public void setOutcomeOfApplication(String outcomeOfApplication) {
                this.outcomeOfApplication = outcomeOfApplication;
        }

        @Column(name = "Notes", length=2147483647)
        public String getNotes() {
                return this.notes;
        }

        public void setNotes(String notes) {
                this.notes = notes;
        }

        @Column(name = "Review_Feedback", length=2147483647)
        public String getReviewFeedback() {
                return this.reviewFeedback;
        }

        public void setReviewFeedback(String reviewFeedback) {
                this.reviewFeedback = reviewFeedback;
        }

        @Column(name = "Status", length = 25)
        @Length(max = 25)
        public String getStatus() {
                return this.status;
        }

        public void setStatus(String status) {
                this.status = status;
        }

        @Column(name = "Date_Entered", nullable = false, length = 0)
        @NotNull
        public Date getDateEntered() {
                return this.dateEntered;
        }

        public void setDateEntered(Date dateEntered) {
                this.dateEntered = dateEntered;
        }

        @Column(name = "Entered_By_User", length = 50)
        @Length(max = 50)
        public String getEnteredByUser() {
                return this.enteredByUser;
        }

        public void setEnteredByUser(String enteredByUser) {
                this.enteredByUser = enteredByUser;
        }

        @Column(name = "Updated_By_User", length = 50)
        @Length(max = 50)
        public String getUpdatedByUser() {
                return this.updatedByUser;
        }

        public void setUpdatedByUser(String updatedByUser) {
                this.updatedByUser = updatedByUser;
        }

        @Column(name = "Date_Last_Updated", nullable = false, length = 0)
        @NotNull
        public Date getDateLastUpdated() {
                return this.dateLastUpdated;
        }

        public void setDateLastUpdated(Date dateLastUpdated) {
                this.dateLastUpdated = dateLastUpdated;
        }
        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy 
= "SApplication")
        public Set getSCorrespondences() {
                return this.SCorrespondences;
        }


}

And here is the generated EntityHome:


package org.hk.crossroads.shippingapp.action;

import org.hk.crossroads.shippingapp.model.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("sApplicationHome")
public class SApplicationHome extends EntityHome {

        public void setApplicationId(Integer id) {
                setId(id);
        }

        public Integer setApplicationId() {
                return (Integer) getId();
        }

        @Override
        protected SApplication createInstance() {
                SApplication sApplication = new SApplication();
                return sApplication;
        }

        public void wire() {
        }

        public boolean isWired() {
                return true;
        }

        public SApplication getDefinedInstance() {
                return isIdDefined() ? getInstance() : null;
        }

        public List getSCorrespondences() {
                return getInstance() == null ? null : new ArrayList(
                                getInstance().getSCorrespondences());
        }

}

And, finally, here is the generated EntityQuery that, I think, is broken

package org.hk.crossroads.shippingapp.action;

import org.hk.crossroads.shippingapp.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.List;
import java.util.Arrays;

@Name("sApplicationList")
public class SApplicationList extends EntityQuery {

        private static final String[] RESTRICTIONS = {
                        "lower(sApplication.shipmentCode) like 
concat(lower(#{sApplicationList.sApplication.shipmentCode}),'%')",
                        "lower(sApplication.region) like 
concat(lower(#{sApplicationList.sApplication.region}),'%')",
                        "lower(sApplication.country) like 
concat(lower(#{sApplicationList.sApplication.country}),'%')",
                        "lower(sApplication.province) like 
concat(lower(#{sApplicationList.sApplication.province}),'%')",
                        "lower(sApplication.organisation) like 
concat(lower(#{sApplicationList.sApplication.organisation}),'%')",
                        "lower(sApplication.contactPerson) like 
concat(lower(#{sApplicationList.sApplication.contactPerson}),'%')",
                        "lower(sApplication.projectType) like 
concat(lower(#{sApplicationList.sApplication.projectType}),'%')",
                        "lower(sApplication.projectBrief) like 
concat(lower(#{sApplicationList.sApplication.projectBrief}),'%')",
                        "lower(sApplication.contentsRequested) like 
concat(lower(#{sApplicationList.sApplication.contentsRequested}),'%')",
                        "lower(sApplication.stateOfRegistration) like 
concat(lower(#{sApplicationList.sApplication.stateOfRegistration}),'%')",
                        "lower(sApplication.oldForms) like 
concat(lower(#{sApplicationList.sApplication.oldForms}),'%')",
                        "lower(sApplication.statusOfApplication) like 
concat(lower(#{sApplicationList.sApplication.statusOfApplication}),'%')",
                        "lower(sApplication.referees) like 
concat(lower(#{sApplicationList.sApplication.referees}),'%')",
                        "lower(sApplication.outcomeOfApplication) like 
concat(lower(#{sApplicationList.sApplication.outcomeOfApplication}),'%')",
                        "lower(sApplication.notes) like 
concat(lower(#{sApplicationList.sApplication.notes}),'%')",
                        "lower(sApplication.reviewFeedback) like 
concat(lower(#{sApplicationList.sApplication.reviewFeedback}),'%')",
                        "lower(sApplication.expectations) like 
concat(lower(#{sApplicationList.sApplication.expectations}),'%')",
                        "lower(sApplication.status) like 
concat(lower(#{sApplicationList.sApplication.status}),'%')",
                        "lower(sApplication.enteredByUser) like 
concat(lower(#{sApplicationList.sApplication.enteredByUser}),'%')",
                        "lower(sApplication.updatedByUser) like 
concat(lower(#{sApplicationList.sApplication.updatedByUser}),'%')",};

        private SApplication sApplication = new SApplication();

        @Override
        public String getEjbql() {
                return "select sApplication from SApplication sApplication";
        }

        @Override
        public Integer getMaxResults() {
                return 25;
        }

        public SApplication getSApplication() {
                return sApplication;
        }

        @Override
        public List getRestrictions() {
                return Arrays.asList(RESTRICTIONS);
        }

}


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104859#4104859

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104859
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to