cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@maniatis.org>
Subject Re: ColumnSelect API + Persistent objects
Date Wed, 08 Mar 2017 00:48:17 GMT
On 7/3/17 11:12pm, Nikita Timofeev wrote:
> 2) Add new factory methods in Property class:
> 
>     <T extends Persistent> Property<T> createSelf(Class<? super T>
type);

Why wouldn't we just use normal constructors?

a = new Property(Artist.class);


>     <T extends Persistent> Property<T> createForRelationship(
>                    Property<?> property, Class<? super T> type)

> 3) Prohibit direct usages of properties mapped on toMany
> relationships, so that the following code will throw a
> CayenneRuntimeException
> 
> List<Object[]> result = ObjectSelect.query(Artist.class)
>         .columns(Artist.ARTIST_NAME, Artist.PAINTING_ARRAY)
>         .select(context);

I'm confused about why we need a new type of property for this rather than just using Artist.PAINTING_ARRAY


Ari


-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Mime
View raw message