Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Collection not displaying all entries

2013-09-16
2015-02-19
  • Hi,

    I have an entity Batmst which contains a collection Batdet. Batdet contains 2 references Employee and Glmast. When the user enters the details of Batdet, they will either enter an Employee number or a GL Code. If I include these columns in the @ListProperties to display the details in the collection then the entries that I capture for the Employee are not displaying in the detail of Batdet. The entries for the GL do display. If I leave these columns out of the @ListProperties, then all the entries display in the detail of Batdet. Here is my code:

    Batmst:

    package org.openxava.salary.model;

    import java.math.;
    import java.util.
    ;
    import javax.persistence.;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.Table;
    import org.openxava.annotations.
    ;
    import org.openxava.calculators.*;

    @Entity
    @Table(name="emp.batmst")
    public class Batmst {

    @Id 
    @ReadOnly
    @SequenceGenerator(name="batch_seq", sequenceName = "acc.batch_seq", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="batch_seq") 
    @Column
    private Integer batchno;
    
    @Required
    @Column(name="capdte")
    @DefaultValueCalculator(value=CurrentDateCalculator.class)
    private Date capdte;
    
    @Column(name="battot")
    @Stereotype("MONEY")
    private BigDecimal battot;
    
    @OneToMany(
            mappedBy="parent",
            cascade=CascadeType.ALL)
    @ListProperties("employee.empno, glmast.glcod, capdte, detamt+")
    private Collection<Batdet> batdetails = new ArrayList<Batdet>();
    
    public Integer getBatchno() {
        return batchno;
    }
    
    public void setBatchno(Integer batchno) {
        this.batchno = batchno;
    }
    
    public Date getCapdte() {
        return capdte;
    }
    
    public void setCapdte(Date capdte) {
        this.capdte = capdte;
    }
    
    public BigDecimal getBattot() {
        return battot;
    }
    
    public void setBattot(BigDecimal battot) {
        this.battot = battot;
    }
    
    public Collection<Batdet> getBatdetails() {
        return batdetails;
    }
    
    public void setBatdetails(Collection<Batdet> batdetails) {
        this.batdetails = batdetails;
    }
    

    }

    Batdet:

    package org.openxava.salary.model;

    import java.math.;
    import java.util.
    ;

    import javax.persistence.*;
    import javax.persistence.Entity;
    import javax.persistence.Table;

    import org.hibernate.annotations.;
    import org.openxava.annotations.
    ;
    import org.openxava.calculators.*;

    @Entity
    @Table(name="emp.batdet")
    public class Batdet {

    @Id @GeneratedValue(generator="system-uuid") @Hidden
    @GenericGenerator(name="system-uuid", strategy="uuid")
    @Column(length=32)
    private String oid;
    
    @ManyToOne
    @JoinColumn(name="batchno")
    private Batmst parent;
    
    @ManyToOne(fetch=FetchType.LAZY, optional=true)
    @ReferenceView("Simple")
    @JoinColumns({
        @JoinColumn(name="glcod", referencedColumnName="glcod"),
        @JoinColumn(name="glsub", referencedColumnName="glsub")
    })
    
    private Glmast glmast;
    @ManyToOne(fetch=FetchType.LAZY, optional=true)
    @ReferenceView("Incentive")
    @JoinColumn(name="empno")
    private Employee employee;
    
    @Required
    @Column(name="capdte")
    @DefaultValueCalculator(value=CurrentDateCalculator.class)
    private Date capdte;
    
    @Stereotype("MONEY")
    private BigDecimal detamt;
    
    public String getOid() {
        return oid;
    }
    
    public void setOid(String oid) {
        this.oid = oid;
    }
    
    public Batmst getParent() {
        return parent;
    }
    
    public void setParent(Batmst parent) {
        this.parent = parent;
    }
    
    public Employee getEmployee() {
        return employee;
    }
    
    public void setEmployee(Employee employee) {
        this.employee = employee;
    }
    
    public Glmast getGlmast() {
        return glmast;
    }
    
    public void setGlmast(Glmast glmast) {
        this.glmast = glmast;
    }
    
    public Date getCapdte() {
        return capdte;
    }
    
    public void setCapdte(Date capdte) {
        this.capdte = capdte;
    }
    
    public BigDecimal getDetamt() {
        return detamt;
    }
    
    public void setDetamt(BigDecimal detamt) {
        this.detamt = detamt;
    }
    

    }

    Have I defined anything incorrectly ?

    I will appreciate any help with this.

    Thanks in advance.

    Med

     
    Last edit: Medasha Govender 2013-09-16
  • Javier Paniza
    Javier Paniza
    2013-09-18

    Hi Med,

    please put here the code for Glmast and Employee too.
    Put here the stacktrace produced when you included all the properties in @ListProperties.

    When you include employee.empno but not glmast.glcod, does it work?
    When you include glmast.glcod but not employee.empno, does it work?


    Help others in this forum as I help you.
    Need more help? Get OpenXava professional support.

     
  • Hi Javier,

    The code for Glmast:

    package org.openxava.salary.model;

    import javax.persistence.;
    import org.apache.commons.lang.
    ;
    import org.openxava.annotations.*;

    @Entity
    @IdClass(GlmastKey.class)
    @Tab(properties="glcod, glsub, glnam")
    @Table(name="acc.glmast")
    @View(name="Simple", members="glcod, glsub, glnam")

    public class Glmast {

    @Id
    @Column(length=4, name="glcod")
    private String glcod;

    @Id
    @Column(length=03, name="glsub")
    private String glsub;

    @Column(length=40, name="glnam")
    private String glnam;

    @Column
    private Integer glvoch;

    public String getGlcod() {
    return glcod;
    }

    public String getGlsub() {
    return glsub;
    }

    public void setGlsub(String glsub) {
    this.glsub = glsub;
    }

    public void setGlcod(String glcod) {
    this.glcod = glcod;
    }

    public String getGlnam() {
    return glnam;
    }

    public void setGlnam(String glnam) {
    this.glnam = WordUtils.capitalizeFully(glnam.trim());
    }

    public Integer getGlvoch() {
    return glvoch;
    }

    public void setGlvoch(Integer glvoch) {
    this.glvoch = glvoch;
    }

    }

    public class GlmastKey
    implements java.io.Serializable {

    private String glcod;
    private String glsub;
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        return obj.toString().equals(this.toString());
    }
    
    @Override
    public int hashCode() {
        return toString().hashCode();
    }
    
    public String getGlcod() {
        return glcod;
    }
    
    public void setGlcod(String glcod) {
        this.glcod = glcod;
    }
    
    @Override
    public String toString(){
        return "GlmastKey::" + glcod + ":" + glsub;
    }
    
    public String getGlsub() {
        return glsub;
    }
    
    public void setGlsub(String glsub) {
        this.glsub = glsub;
    }
    

    }

    The code for Employee:
    package org.openxava.salary.model;
    import org.apache.commons.lang.WordUtils;
    import org.hibernate.annotations.Parameter;

    import java.math.*;

    import javax.persistence.*;

    import org.openxava.annotations.;
    import org.openxava.calculators.
    ;
    import org.openxava.salary.action.*;

    @Entity
    @Table(name="emp.employee")

    @Views({
    @View(members="General {#" +
    "empno;" +
    "title, empname, matack;" +
    "department; branch}" +
    "Tab {#" +
    "empsal; testing}"),

       @View(name="Incentive", members= "empno; empname")
    

    })

    public class Employee {
    @Id @Column(length=3)
    public String empno;

    @Column (length=40) 
    @Required
    private String branch;
    
    @ManyToOne(fetch=FetchType.LAZY, optional=true)
    @NoFrame
    private Title title;
    
    @Column(name="matack", length=1)
    @DefaultValueCalculator(value=EnumCalculator.class,
            properties={@PropertyValue(name="enumType", value="org.openxava.salary.model.Employee$Matack"),
                        @PropertyValue(name="value", value="Yes")
    })
    
     @org.hibernate.annotations.Type(type="org.openxava.types.EnumLetterType", 
                parameters={
                  @Parameter(name="letters", value="YN"), 
                  @Parameter(name="enumType", value="org.openxava.salary.model.Employee$Matack")
                }
              )
    
    @OnChange(SetTab1.class)
    private Matack matack;
    public enum Matack{Yes, No};
    
    @Column (length=40) 
    @Required
    private String empname;
    
    @ManyToOne(fetch=FetchType.LAZY, optional=false)
    @ReferenceView("Simple")
    private Department department;
    
    @Stereotype("MONEY")
    private BigDecimal empsal;
    
    @Column
    private int testing;
    
    public String getEmpno() {
        return empno;
    }
    
    public void setEmpno(String empno) {
        this.empno = empno;
    }
    
    public Title getTitle() {
        return title;
    }
    
    public void setTitle(Title title) {
        this.title = title;
    }
    
    public String getEmpname() {
        return empname;
    }
    
    public void setEmpname(String empname) {
        this.empname = WordUtils.capitalizeFully(empname.trim());
    }
    
    public Department getDepartment() {
        return department;
    }
    
    public void setDepartment(Department department) {
        this.department = department;
    }
    
    public String getBranch() {
        return branch;
    }
    
    public void setBranch(String branch) {
        this.branch = branch;
    }
    
    public Matack getMatack() {
        return matack;
    }
    
    public void setMatack(Matack matack) {
        this.matack = matack;
    }
    
    public BigDecimal getEmpsal() {
        return empsal==null?BigDecimal.ZERO:empsal;
    }
    
    public void setEmpsal(BigDecimal empsal) {
        this.empsal = empsal;
    }
    
    public int getTesting() {
        return testing;
    }
    
    public void setTesting(int testing) {
        this.testing = testing;
    }
    

    }

    The stacktrace:

    20 Sep 2013 9:31:15 AM org.openxava.controller.ModuleManager <clinit>
    INFO: OpenXava 4.7 (2013-4-2)
    20 Sep 2013 9:31:15 AM org.hibernate.annotations.common.Version <clinit>
    INFO: Hibernate Commons Annotations 3.2.0.Final
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 3.6.10.Final
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: Bytecode provider name : javassist
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.Environment <clinit>
    INFO: using JDK 1.4 java.sql.Timestamp handling
    20 Sep 2013 9:31:15 AM org.hibernate.ejb.Version <clinit>
    INFO: Hibernate EntityManager 3.6.10.Final
    20 Sep 2013 9:31:15 AM org.hibernate.util.DTDEntityResolver resolveEntity
    WARNING: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
    INFO: Mapping class: org.openxava.session.GalleryImage -> IMAGES
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.EnableSections
    20 Sep 2013 9:31:15 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.EnableSections on table emp.test
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.GlmastEnq
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.GlmastEnq on table acc.glmast
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: com.openxava.naviox.model.User
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity com.openxava.naviox.model.User on table OXUSERS
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.GLTran
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.GLTran on table emp.glttrn
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Region
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Region on table emp.region
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.GLenq
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.GLenq on table emp.glmast
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Glmast
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Glmast on table acc.glmast
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.TravelBatch
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.TravelBatch on table emp.travelbatch
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Title
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Title on table emp.title
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Travel
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Travel on table emp.travel
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Department
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Department on table emp.department
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Catmst
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Catmst on table gen.catmst
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Batdet
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Batdet on table emp.batdet
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.TravelEntry
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.TravelEntry on table emp.travelentry
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: com.openxava.naviox.model.Role
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity com.openxava.naviox.model.Role on table OXROLES
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: com.openxava.naviox.model.Folder
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity com.openxava.naviox.model.Folder on table OXFOLDERS
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: com.openxava.naviox.model.Module
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity com.openxava.naviox.model.Module on table OXMODULES
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Client
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Client on table cli.clidet
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Incentive
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Incentive on table emp.incentive
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Batmst
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Batmst on table emp.batmst
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Arrtest
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Arrtest on table emp.employee
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.Employee
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.Employee on table emp.employee
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: org.openxava.salary.model.EmpIncentive
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity org.openxava.salary.model.EmpIncentive on table emp.empincentive
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
    INFO: Mapping collection: org.openxava.salary.model.GlmastEnq.trndetails -> emp.glttrn
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
    INFO: Mapping collection: org.openxava.salary.model.GLenq.trndetails -> emp.glttrn
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
    INFO: Mapping collection: org.openxava.salary.model.TravelBatch.entries -> emp.travelentry
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
    INFO: Mapping collection: com.openxava.naviox.model.Folder.modules -> OXMODULES
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
    INFO: Mapping collection: com.openxava.naviox.model.Folder.subfolders -> OXFOLDERS
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
    INFO: Mapping collection: org.openxava.salary.model.Batmst.batdetails -> emp.batdet
    20 Sep 2013 9:31:16 AM org.hibernate.validator.Version <clinit>
    INFO: Hibernate Validator 3.1.0.GA
    20 Sep 2013 9:31:16 AM org.hibernate.validator.util.Version <clinit>
    INFO: Hibernate Validator 4.1.0.Final
    20 Sep 2013 9:31:16 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    20 Sep 2013 9:31:16 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    20 Sep 2013 9:31:16 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
    INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.search.HibernateSearchEventListenerRegister enableHibernateSearch
    INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
    20 Sep 2013 9:31:16 AM org.hibernate.util.NamingHelper getInitialContext
    INFO: JNDI InitialContext properties:{}
    20 Sep 2013 9:31:16 AM org.hibernate.connection.DatasourceConnectionProvider configure
    INFO: Using datasource: java:comp/env/jdbc/SalaryDS
    20 Sep 2013 9:31:16 AM org.hibernate.dialect.Dialect <init>
    INFO: Using dialect: org.hibernate.dialect.PostgreSQLDialect
    20 Sep 2013 9:31:16 AM org.hibernate.engine.jdbc.JdbcSupportLoader useContextualLobCreation
    INFO: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Database ->
    name : PostgreSQL
    version : 9.1.5
    major : 9
    minor : 1
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Driver ->
    name : PostgreSQL Native Driver
    version : PostgreSQL 9.1 JDBC4 (build 901)
    major : 9
    minor : 1
    20 Sep 2013 9:31:16 AM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    INFO: Using default transaction strategy (direct JDBC transactions)
    20 Sep 2013 9:31:16 AM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic flush during beforeCompletion(): disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic session close at end of transaction: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC batch size: 15
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC batch updates for versioned data: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Scrollable result sets: enabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC3 getGeneratedKeys(): enabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Connection release mode: auto
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default batch fetch size: 1
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Generate SQL with comments: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL updates by primary key: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL inserts for batching: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
    INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    20 Sep 2013 9:31:16 AM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
    INFO: Using ASTQueryTranslatorFactory
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query language substitutions: {}
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JPA-QL strict compliance: enabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Second-level cache: enabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query cache: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory createRegionFactory
    INFO: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Optimize cache for minimal puts: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Structured second-level cache entries: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Statistics: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Deleted entity synthetic identifier rollback: disabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default entity-mode: pojo
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Named query checking : enabled
    20 Sep 2013 9:31:16 AM org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Check Nullability in Core (should be disabled when Bean Validation is on): disabled
    20 Sep 2013 9:31:16 AM org.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    20 Sep 2013 9:31:16 AM org.hibernate.type.BasicTypeRegistry register
    INFO: Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@6c484c6b
    20 Sep 2013 9:31:16 AM org.hibernate.id.UUIDHexGenerator <init>
    WARNING: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead
    20 Sep 2013 9:31:17 AM org.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id Batmst
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id Batdet
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id Glmast
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id Department
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id batdet
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id Batmst
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id Batmst
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id batchno
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id capdte
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id battot
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id batchno
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id capdte
    20 Sep 2013 9:31:17 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id battot
    20 Sep 2013 9:31:17 AM org.openxava.tab.impl.JPATabProvider nextBlock
    FINE: [JPATabProvider.nextBlock] Executing SELECT e.batchno, e.batchno, e.capdte, e.battot from Batmst e with arguments
    20 Sep 2013 9:31:17 AM org.openxava.tab.impl.TableModelBean getRow
    FINE: nextChunk=247
    20 Sep 2013 9:31:18 AM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.getStrokeActions()
    20 Sep 2013 9:31:21 AM org.directwebremoting.util.CommonsLoggingOutput info
    INFO: Exec: Module.request()
    20 Sep 2013 9:31:21 AM org.openxava.controller.ModuleManager execute
    FINE: Execute List.viewDetail=91 ms
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id batchno
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id batchno
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id capdte
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id capdte
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id battot
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id battot
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id batdetails
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id glcod
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id capdte
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id detamt
    20 Sep 2013 9:31:21 AM org.openxava.tab.impl.JPATabProvider nextBlock
    FINE: [JPATabProvider.nextBlock] Executing SELECT e.oid, e.glmast.glcod, e.capdte, e.detamt from Batdet e WHERE e.parent.batchno = :p0 with arguments 6
    20 Sep 2013 9:31:21 AM org.openxava.tab.impl.TableModelBean getRow
    FINE: nextChunk=56
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id detamt
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id glcod
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id glmast
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id capdte
    20 Sep 2013 9:31:21 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id detamt
    20 Sep 2013 9:31:22 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id removeColumnSum
    20 Sep 2013 9:31:22 AM org.openxava.util.Labels get
    WARNING: Impossible to translate element with id removeColumnSum

    It works if I include employee.empno and not glmast.glcod.
    It does not work if I include glmast.glcod but not employee.empno.

    Thanks for the help. Much appreciated.

    Med

     
  • Hi Javier,

    The problem seems to be caused by the composite key in Glmast. It works correctly if I reference any other entity that does not contain a composite key. Is there any way to work around this ?

    Thank u.

    Med

     
  • Javier Paniza
    Javier Paniza
    2013-09-23

    Hi Med,

    the JPA query is correct:

    SELECT e.oid, e.glmast.glcod, e.capdte, e.detamt from Batdet e WHERE e.parent.batchno = :p0 with arguments 6
    

    Given that glcod is the key of the reference the join is not needed, because this date is in the main table. Maybe this is a Hiberante bug. Anyways, I think I could fix it from OpenXava, adding a JOIN with the other entity when composite key would be use. Please, add a bug about it and I'll revise this issue.

    In the meantime, we can use some trick to solve the problem. Try to define a persistent field (call it code) mapped (using @Column) againts the same database column. Define the @Column with insertable and updatable to false. Then use this property in @ListProperty. Tell me if it works for you.


    Help others in this forum as I help you.
    Need more help? Get OpenXava professional support.

     
  • Hi Javier,

    Thank u. The "trick" worked.
    I will add it as a bug as well.

    Thanks a mill.

    Med

     
  • Javier Paniza
    Javier Paniza
    2015-02-19

    Hi Med,

    I tried your code with OpenXava 5.2 and really it fails. However, I achieve that it work fine just changing the table definition from this:

    @Table(name="emp.batmst")
    

    By;

    @Table(schema="emp", name="batmst")
    

    For all tables.

    Seems that Hibernate needs to know what is the table name and what is the schema name to create the SQL sentences correctly. So finally is not a Hibernate bug or OpenXava bug.

    I closed the bug.