Announcement Announcement Module
Collapse
No announcement yet.
@Transient field not set when set object from class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Transient field not set when set object from class

    hi all
    I have 2 table with one to many relation in database and classes for those for example A and B.

    and I need a field in class A that return first relative B for example firstresult

    PHP Code:
    @Transient
        B firstresult
    ;
        public 
    B getFirstresult() {
            return 
    firstresult;
        }
        public 
    void setFirstresult(B firstresult) {
            
    this.firstresult firstresult;
        } 
    and set this firstresult in this method in class A
    PHP Code:
    public String B() {
            
            for (
    B iterable_element bs) {
                if (
    condition)
                
    this.firstresult iterable_element;
            }
            return 
    "";
        } 
    when I get list from dao and show in xhtml this firstresult has true value ,but when select item A from datatable and write in console this firstresult is null ,
    whats happens?
    Last edited by anisa; May 5th, 2013, 03:18 AM.
Working...
X