1 Reply Latest reply on Jul 10, 2007 5:13 AM by pmuir

    bijection question - value could not be converted to the exp

      I am almost done evaluating seam - bijection is cool. However, I am trying to avoid it. What is its value if we have getter/setter introspection?. In any case, here is my issue:

      controller - the below getters and setters are also in the interface

      @Stateful
      @Name("indexPage")
      @Scope(org.jboss.seam.ScopeType.SESSION)
      public class IndexPageBean implements IndexPage {
      
       @Logger
       private Log log;
      
       @In
       FacesMessages facesMessages;
      
       private LoanApplication loanApplication;
      .
      .
       public LoanApplication getLoanApplication()
       {
       return loanApplication;
       }
       public void setLoanApplication(LoanApplication loanApplication)
       {
       this.loanApplication = loanApplication;
       }
      


      view
       <form name="BorrowerForm" id="BorrowerForm" jsfc="h:form">
       <div id="ageDiv">
       <label>AGE:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{indexPage.loanApplication.borrower.age}"/>
       </label>
       </div>
       <div id="grossIncomeDiv">
       <label>GROSS:
       <input type="text" name="textfield" jsfc="h:inputText" value="#{indexPage.loanApplication.borrower.grossIncome}"/>
       </label>
       </div>
       <div id="submitBorrower">
       <input type="submit" jsfc="h:commandButton" id="submitBorrowerButton" action="#{indexPage.submitBorrower}" value="Submit" />
       </div>
       </form>
      


      model
      @Entity
      @Name("LoanApplication")
      //could have @table annotation here to specify which table to map to
      public class LoanApplication {
      
       //RELATIONSHIPS
       private Borrower borrower = new Borrower();
       private Property property = new Property();
      .
      .
       @OneToOne
       // If name parm is ommitted, then assumed to be fieldName_reference PK, i.e. borrower_id
       // If referencedColumn ommitted, assumed to be the referenced PK, i.E. Borrower.Id, i.e. Id
       @JoinColumn(name="BorrowerId", referencedColumnName="Id", updatable=false, insertable=false)
       public Borrower getBorrower()
       {
       return borrower;
       }
       public void setBorrower(Borrower borrower)
       {
       this.borrower = borrower;
       }
      

      @Entity
      @Name("Borrower")
      public class Borrower {
       private int Id;
       private int age;
       private BigDecimal AffordableLoanAmount;
       private BigDecimal grossIncome;
      .
      .
      getters/setters
      



      ERROR - comes from h:messages tag after submitting borrower form


      * value could not be converted to the expected type
      * value could not be converted to the expected type


      Why the above errors?