here the record class will not be generated.I found a sql workaround but maybe you want to make mechanoid more perfect. Union makes the problem
create view vehiclegroup as
select _id as _id, name as name,
count(*) as cnt,
sum(canBeRented) as canBeRented
from vehicle where name <> '-'
group by name;
union
select _id, name, 1 as cnt, canBeRented
from vehicle where name = '-';
here cast makes the problem
select _id, name, count(*),
cast (sum(canBeRented) as integer) as canBeRented
from vehicle where name <> '-'
group by name
// union
// select _id, name, 1, canBeRented
// from vehicle where name = '-'
btw, I solved it like this (group only with valid name)
create view vehiclegroup as
select _id as _id, case when name <> '-' then name else name||_id end as name,
count(*) as cnt,
sum(canBeRented) as canBeRented
from vehicle
group by case when name <> '-' then name else name ||_id end;
here the record class will not be generated.I found a sql workaround but maybe you want to make mechanoid more perfect. Union makes the problem
here cast makes the problem
btw, I solved it like this (group only with valid name)