CollectionDatasource Error

I’m attempting to replicate the “sample/web/airports_3/airport/airport-browse.xml” screen included in the “screen-manipulation” example.
What I’m trying to do is connect two grids (like master-details).
I get an error in this line:

    
@Inject
private CollectionDatasource<TAree, UUID> tAreeDs;

.java:24: error: type argument TAree is not within bounds of type-variable T
private CollectionDatasource<TAree, UUID> tAreeDs;

My datasource is a MSSQL database.
Table TAree has only two fields:

  • ID_Area (PK, int)
  • Area (string)

I cannot find a solution.
Thank you
Michele

Hello everyone.
I realized that the problem exists when the table as a PK (int, not null, identity).
If the PK is, for example, char(1) there is no problem.

Steps to reproduce:

  1. Create table (in my environment is MSSQL)
    CREATE TABLE [dbo].[TabTest](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Valore] nvarchar NOT NULL,
    CONSTRAINT [PK_TabTest] PRIMARY KEY CLUSTERED
    (
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]

  2. Create new Cuba Project

  3. Generate model with this table and choose to create a Single Screen type

  4. Build project

You receive an error like this:

java:29: error: type argument TabTest is not within bounds of type-variable T
private CollectionDatasource<TabTest, IdProxy> tabTestsDs;
^
where T,K are type-variables:
T extends Entity declared in interface CollectionDatasource
K extends Object declared in interface CollectionDatasource
1 error
FAILED

FAILURE: Build failed with an exception.

Thanks for your help.

The problem is with 6.6.x Platform version.
Everything works properly with 6.5.7.

Hi Michele,

Thank you for the detailed reporting of the problem.

The screen template for combined screen is indeed invalid. We have created an issue: https://youtrack.cuba-platform.com/issue/STUDIO-3954 and we’ll fix it in the next bug-fix Studio release.

You can fix the problem in your code if you add a type parameter corresponding to your entity PK type:

private CollectionDatasource<TabTest, IdProxy<Integer>> tabTestsDs;

or

private CollectionDatasource<TabTest, IdProxy<Long>> tabTestsDs;