IllegalArgumentException with master-detail UI

Hi,

I tried to build up a master-detail ui according to the example shown in video Quick Start, Part 3.
I followed step by step but with my entities based on an Orcale DB.
grafik

When running the application I get the following SQL error:

grafik
with the text:
"IllegalArgumentException: You have attempted to set a value of type class java.lang.String for parameter ds_herDs with expected type of class com.company.testoracle.entity.Her from query string _
_ select e from testoracle$Anp e

where e.herKurz = :ds_herDs
order by e.name
_ ."_

I do not understand the construct “where e.herKurz = :ds_herDs_
also the clause “where e.herKurz = :ds_herDs_kurz”, found in the manual leads to the same error.
So, how to solve this problem?
Thanks, Thomas

Hey!

Thomas change your query string: where e.herKurz.id = :ds$herDs

done, but now got the error:
JPQLException: _
Exception Description: Problem compiling [
_ select e from testoracle$Anp e

where e.herKurz.id = :ds_herDs
order by e.name
_ ]. _
[37, 49] The state field path ‘e.herKurz.id’ cannot be resolved to a valid type.

Please post markup of screen controller and source Anp entity.

hope, this is what you requested…
grafik
grafik
grafik
grafik

add screen of tab “XML” on last screenshot

Here we are…

grafik
grafik

Hey!

Thomas change your query string: where e.herKurz.kurz = :ds$herDs

Hi Kirill, now it works, thanks for your input. This notation ist a little bit strange for me, but anyway…

I now implemented my database tables in Studio and generated the depending UIs.
This works quite good but in some references/associations between fields in another table allication works in the following way:

  1. I don’t get a dropdown menu although defined in my data model
  2. the returned values of the table into the source filed are cryptic or references not the matching fields.
    in the screens above you can see this behaviour:

grafik
In column “Podukt Typ” there should appear the key to this table (e.g. SMGw HW) instead of this cryptic string
In column “Hersteller” there should appear the short description (e.g. PPC) instead of the company’s name
This forces, of course, an error when trying to deiting this row.

grafik
In this screenshot you can see the missing dropdown for “Podukt Typ” and “Hersteller”

Thanks in advance, Thomas

Hey!

Check edit views for entity “Pro” add field “Podukt Typ” and “Hersteller”
or check instance name for entities “Podukt Typ” and “Hersteller”

Hi Kirill,
maybe I’m too stupid with my last tries. So, I started from the scratch re-building the small application from the video creating “customer” and “order” entity and UI exactly step by step with the result see below:

grafik
grafik
This is not what I expected and I don’t find the handle to solve this problem…

Hi, Thomas!

Upload the archive with this application.

Hi, I uploaded a zip-file from the complete project folder of this application, hoping this is what you wanted…

I can not see the link to the archive

ok I try again

but I think Zip-File too large with 66 MB, so I skipped Tomcat folder, hope this is ok
TEST_HSQLDB.7z (146.3 KB)

Ok

Tip!
To create an archive of only project files, use gradle task ‘zip’

… and how to invoke zip? gradle --zipProject does not work

It can be called from the search dialog in CUBA Studio.
image

here we are…TEST_HSQLDB.zip (89.1 KB)

Hey!

Fill instance name for Customer entity.

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.chile.core.annotations.NamePattern;

@NamePattern("%s|customer")
@Table(name = "TESTHSQLDB_CUSTOMER")
@Entity(name = "testhsqldb$Customer")
public class Customer extends StandardEntity {
    private static final long serialVersionUID = 4255676466638158722L;

    @Column(name = "CUSTOMER", nullable = false, length = 50)
    protected String customer;

    @Column(name = "EMAIL", length = 50)
    protected String email;

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public String getCustomer() {
        return customer;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }
}

image

image