Re: problem with ExtendedType in Cayenne 4.2

2020-08-07 Thread Andrea Biasillo
Hi Nikita and thanks a lot!

Your input worked. Sorry for the late reply.

Many regards,
Andrea

On 2020/06/30 10:19:04, Nikita Timofeev  wrote: 
> Hi Andrea,
> 
> This change is mine so let me answer.
> There is a new flush action implementation in 4.2 and it uses
> EntitySorter differently.
> To be more specific it uses dbEntityComparator directly and doesn't
> call 'sortDbEntities' method anymore.
> 
> Depending on your use case you could either move your logic to the comparator,
> or you could move it to a custom implementation of the DbRowOpSorter 
> interface.
> 
> As a quick fix you also could use old flush action implementation:
> binder.bind(DataDomainFlushActionFactory.class).to(LegacyDataDomainFlushActionFactory.class);
> 
> Hope this helps.
> 
> On Mon, Jun 29, 2020 at 3:16 PM Andrea Biasillo  wrote:
> >
> > Hi!
> >
> > the method sortDbEntities of our EntitySorter  is not invoked with 4.2.
> >
> > We register the EntitySorter in this way:
> >
> >
> >
> > public class DataloyOracleModule implements Module {
> >
> > @Inject AdhocObjectFactory objFac;
> >
> > @Override
> > public void configure(Binder binder) {
> > ServerModule.contributeAdapterDetectors(binder).add(new 
> > DataloyOracleSniffer());
> > ServerModule.useExternalTransactions(binder, true);
> >
> > 
> > binder.bind(EntitySorter.class).to(DataloyEntitySorter.class).withoutScope();
> > binder.bind(PkGenerator.class).to(DataloyPkGenerator.class);
> > 
> > binder.bind(BatchTranslatorFactory.class).to(DataloyQueryBuilderFactory.class);
> >
> > }
> >
> > }
> >
> >
> >
> >
> >
> > On 2020/06/29 11:17:34, Andrea Biasillo  wrote:
> > > Hi Andrus!
> > >
> > > I think the problem is related to our EntitySorter implementation. 
> > > Something has been changed  in 4.2 with EntitySorter.
> > >
> > > Many regards,
> > > Andrea
> > >
> > > On 2020/06/29 09:45:03, Andrea Biasillo  wrote:
> > > > Hi Andrus!
> > > >
> > > > I will provide the code soon as possible.
> > > >
> > > > Many thanks
> > > >
> > > > On 2020/06/29 09:23:27, Andrus Adamchik  wrote:
> > > > > Could you send a Cayenne query example where this happens?
> > > > >
> > > > > Andrus
> > > > >
> > > > >
> > > > > > On Jun 29, 2020, at 12:20 PM, Andrea Biasillo  
> > > > > > wrote:
> > > > > >
> > > > > > Hi Andrus!
> > > > > >
> > > > > > I think our DataloyOracleAdapter  is in use, at startup in the 
> > > > > > Wildfly log we get this:
> > > > > >
> > > > > > [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool 
> > > > > > -- 87) Detected and installed adapter: 
> > > > > > com.dataloy.platform.DataloyOracleAdapter
> > > > > >
> > > > > > Also another thing is the the method setJdbcObject is invoked, but 
> > > > > > not materializeObject
> > > > > >
> > > > > > Regards,
> > > > > > Andrea
> > > > > >
> > > > > > On 2020/06/29 08:35:05, Andrus Adamchik  
> > > > > > wrote:
> > > > > >> Here is another random idea - could you verify that your adapter 
> > > > > >> is in use?
> > > > > >>
> > > > > >> Andrus
> > > > > >>
> > > > > >>> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  
> > > > > >>> wrote:
> > > > > >>>
> > > > > >>> Hi Andrus and thank you!
> > > > > >>>
> > > > > >>> I tried to override configureExtendedTypes but still the method 
> > > > > >>> materializeObject is not inoked.
> > > > > >>>
> > > > > >>> Regards,
> > > > > >>> Andrea
> > > > > >>>
> > > > > >>> On 2020/06/29 08:19:15, Andrus Adamchik  
> > > > > >>> wrote:
> > > > >  Hi Andrea,
> > > > > 
> > > > >  "materializeObject" method should still be called of course. 
> > > > >  When registering custom types within the adapter, I'd usually 
> > > > >  override "configureExtendedTypes":
> > > > > 
> > > > >  @Override
> > > > >  protected void configureExtendedTypes(ExtendedTypeMap map) {
> > > > >    super.configureExtendedTypes(map);
> > > > >    map.registerType(new SourceIdType());
> > > > >  }
> > > > > 
> > > > >  I suspect it might make a difference, considering somewhat 
> > > > >  complicated type override rules in the adapter.
> > > > > 
> > > > >  Andrus
> > > > > 
> > > > > 
> > > > > > On Jun 29, 2020, at 11:04 AM, Andrea Biasillo 
> > > > > >  wrote:
> > > > > >
> > > > > > Hi!
> > > > > >
> > > > > > We are migrating from 4.0.2 to 4.2. We have a class that 
> > > > > > implements ExtendedType.
> > > > > > In 4.0.2 the method:
> > > > > >
> > > > > > public SourceId materializeObject(ResultSet rs, int index, int 
> > > > > > type) throws Exception
> > > > > >
> > > > > > was invoked, but not in 4.2.
> > > > > >
> > > > > > We register our class in this way:
> > > > > >
> > > > > > public class DataloyOracleAdapter extends OracleAdapter {
> > > > > >
> > > > > > public DataloyOracleAdapter(@Inject RuntimeProperties 
> > > > 

Re: problem with ExtendedType in Cayenne 4.2

2020-06-30 Thread Nikita Timofeev
Hi Andrea,

This change is mine so let me answer.
There is a new flush action implementation in 4.2 and it uses
EntitySorter differently.
To be more specific it uses dbEntityComparator directly and doesn't
call 'sortDbEntities' method anymore.

Depending on your use case you could either move your logic to the comparator,
or you could move it to a custom implementation of the DbRowOpSorter interface.

As a quick fix you also could use old flush action implementation:
binder.bind(DataDomainFlushActionFactory.class).to(LegacyDataDomainFlushActionFactory.class);

Hope this helps.

On Mon, Jun 29, 2020 at 3:16 PM Andrea Biasillo  wrote:
>
> Hi!
>
> the method sortDbEntities of our EntitySorter  is not invoked with 4.2.
>
> We register the EntitySorter in this way:
>
>
>
> public class DataloyOracleModule implements Module {
>
> @Inject AdhocObjectFactory objFac;
>
> @Override
> public void configure(Binder binder) {
> ServerModule.contributeAdapterDetectors(binder).add(new 
> DataloyOracleSniffer());
> ServerModule.useExternalTransactions(binder, true);
>
> 
> binder.bind(EntitySorter.class).to(DataloyEntitySorter.class).withoutScope();
> binder.bind(PkGenerator.class).to(DataloyPkGenerator.class);
> 
> binder.bind(BatchTranslatorFactory.class).to(DataloyQueryBuilderFactory.class);
>
> }
>
> }
>
>
>
>
>
> On 2020/06/29 11:17:34, Andrea Biasillo  wrote:
> > Hi Andrus!
> >
> > I think the problem is related to our EntitySorter implementation. 
> > Something has been changed  in 4.2 with EntitySorter.
> >
> > Many regards,
> > Andrea
> >
> > On 2020/06/29 09:45:03, Andrea Biasillo  wrote:
> > > Hi Andrus!
> > >
> > > I will provide the code soon as possible.
> > >
> > > Many thanks
> > >
> > > On 2020/06/29 09:23:27, Andrus Adamchik  wrote:
> > > > Could you send a Cayenne query example where this happens?
> > > >
> > > > Andrus
> > > >
> > > >
> > > > > On Jun 29, 2020, at 12:20 PM, Andrea Biasillo  
> > > > > wrote:
> > > > >
> > > > > Hi Andrus!
> > > > >
> > > > > I think our DataloyOracleAdapter  is in use, at startup in the 
> > > > > Wildfly log we get this:
> > > > >
> > > > > [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool 
> > > > > -- 87) Detected and installed adapter: 
> > > > > com.dataloy.platform.DataloyOracleAdapter
> > > > >
> > > > > Also another thing is the the method setJdbcObject is invoked, but 
> > > > > not materializeObject
> > > > >
> > > > > Regards,
> > > > > Andrea
> > > > >
> > > > > On 2020/06/29 08:35:05, Andrus Adamchik  
> > > > > wrote:
> > > > >> Here is another random idea - could you verify that your adapter is 
> > > > >> in use?
> > > > >>
> > > > >> Andrus
> > > > >>
> > > > >>> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  
> > > > >>> wrote:
> > > > >>>
> > > > >>> Hi Andrus and thank you!
> > > > >>>
> > > > >>> I tried to override configureExtendedTypes but still the method 
> > > > >>> materializeObject is not inoked.
> > > > >>>
> > > > >>> Regards,
> > > > >>> Andrea
> > > > >>>
> > > > >>> On 2020/06/29 08:19:15, Andrus Adamchik  
> > > > >>> wrote:
> > > >  Hi Andrea,
> > > > 
> > > >  "materializeObject" method should still be called of course. When 
> > > >  registering custom types within the adapter, I'd usually override 
> > > >  "configureExtendedTypes":
> > > > 
> > > >  @Override
> > > >  protected void configureExtendedTypes(ExtendedTypeMap map) {
> > > >    super.configureExtendedTypes(map);
> > > >    map.registerType(new SourceIdType());
> > > >  }
> > > > 
> > > >  I suspect it might make a difference, considering somewhat 
> > > >  complicated type override rules in the adapter.
> > > > 
> > > >  Andrus
> > > > 
> > > > 
> > > > > On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  
> > > > > wrote:
> > > > >
> > > > > Hi!
> > > > >
> > > > > We are migrating from 4.0.2 to 4.2. We have a class that 
> > > > > implements ExtendedType.
> > > > > In 4.0.2 the method:
> > > > >
> > > > > public SourceId materializeObject(ResultSet rs, int index, int 
> > > > > type) throws Exception
> > > > >
> > > > > was invoked, but not in 4.2.
> > > > >
> > > > > We register our class in this way:
> > > > >
> > > > > public class DataloyOracleAdapter extends OracleAdapter {
> > > > >
> > > > > public DataloyOracleAdapter(@Inject RuntimeProperties 
> > > > > runtimeProperties,
> > > > > @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> > > > > List defaultExtendedTypes,
> > > > > @Inject(Constants.SERVER_USER_TYPES_LIST) 
> > > > > List userExtendedTypes,
> > > > > @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> > > > > List extendedTypeFactories,
> > > > > 

Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrea Biasillo
Hi!

the method sortDbEntities of our EntitySorter  is not invoked with 4.2.

We register the EntitySorter in this way:



public class DataloyOracleModule implements Module {

@Inject AdhocObjectFactory objFac;

@Override
public void configure(Binder binder) {
ServerModule.contributeAdapterDetectors(binder).add(new 
DataloyOracleSniffer());
ServerModule.useExternalTransactions(binder, true);


binder.bind(EntitySorter.class).to(DataloyEntitySorter.class).withoutScope();
binder.bind(PkGenerator.class).to(DataloyPkGenerator.class);

binder.bind(BatchTranslatorFactory.class).to(DataloyQueryBuilderFactory.class);

}

}





On 2020/06/29 11:17:34, Andrea Biasillo  wrote: 
> Hi Andrus!
> 
> I think the problem is related to our EntitySorter implementation. Something 
> has been changed  in 4.2 with EntitySorter.
> 
> Many regards,
> Andrea
> 
> On 2020/06/29 09:45:03, Andrea Biasillo  wrote: 
> > Hi Andrus!
> > 
> > I will provide the code soon as possible.
> > 
> > Many thanks 
> > 
> > On 2020/06/29 09:23:27, Andrus Adamchik  wrote: 
> > > Could you send a Cayenne query example where this happens? 
> > > 
> > > Andrus
> > > 
> > > 
> > > > On Jun 29, 2020, at 12:20 PM, Andrea Biasillo  wrote:
> > > > 
> > > > Hi Andrus!
> > > > 
> > > > I think our DataloyOracleAdapter  is in use, at startup in the Wildfly 
> > > > log we get this:
> > > > 
> > > > [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool -- 
> > > > 87) Detected and installed adapter: 
> > > > com.dataloy.platform.DataloyOracleAdapter
> > > > 
> > > > Also another thing is the the method setJdbcObject is invoked, but not 
> > > > materializeObject
> > > > 
> > > > Regards,
> > > > Andrea
> > > > 
> > > > On 2020/06/29 08:35:05, Andrus Adamchik  wrote: 
> > > >> Here is another random idea - could you verify that your adapter is in 
> > > >> use? 
> > > >> 
> > > >> Andrus
> > > >> 
> > > >>> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  
> > > >>> wrote:
> > > >>> 
> > > >>> Hi Andrus and thank you!
> > > >>> 
> > > >>> I tried to override configureExtendedTypes but still the method 
> > > >>> materializeObject is not inoked.
> > > >>> 
> > > >>> Regards,
> > > >>> Andrea
> > > >>> 
> > > >>> On 2020/06/29 08:19:15, Andrus Adamchik  
> > > >>> wrote: 
> > >  Hi Andrea,
> > >  
> > >  "materializeObject" method should still be called of course. When 
> > >  registering custom types within the adapter, I'd usually override 
> > >  "configureExtendedTypes":
> > >  
> > >  @Override
> > >  protected void configureExtendedTypes(ExtendedTypeMap map) {
> > >    super.configureExtendedTypes(map);
> > >    map.registerType(new SourceIdType());
> > >  }
> > >  
> > >  I suspect it might make a difference, considering somewhat 
> > >  complicated type override rules in the adapter.
> > >  
> > >  Andrus
> > >  
> > >  
> > > > On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  
> > > > wrote:
> > > > 
> > > > Hi!
> > > > 
> > > > We are migrating from 4.0.2 to 4.2. We have a class that implements 
> > > > ExtendedType. 
> > > > In 4.0.2 the method:
> > > > 
> > > > public SourceId materializeObject(ResultSet rs, int index, int 
> > > > type) throws Exception 
> > > > 
> > > > was invoked, but not in 4.2.
> > > > 
> > > > We register our class in this way:
> > > > 
> > > > public class DataloyOracleAdapter extends OracleAdapter {
> > > > 
> > > > public DataloyOracleAdapter(@Inject RuntimeProperties 
> > > > runtimeProperties, 
> > > > @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> > > > List defaultExtendedTypes,
> > > > @Inject(Constants.SERVER_USER_TYPES_LIST) 
> > > > List userExtendedTypes, 
> > > > @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> > > > List extendedTypeFactories,
> > > > @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> > > > ResourceLocator resourceLocator, 
> > > > @Inject ValueObjectTypeRegistry 
> > > > valueObjectTypeRegistry) {
> > > > super(runtimeProperties, defaultExtendedTypes, 
> > > > userExtendedTypes, extendedTypeFactories, resourceLocator,
> > > > valueObjectTypeRegistry);
> > > > setSupportsGeneratedKeys(false);
> > > > //super.setPkGenerator(new DataloyPkGenerator());
> > > > 
> > > > setSupportsBatchUpdates(false);
> > > > this.extendedTypes.registerType(new SourceIdType());
> > > > }
> > > > 
> > > > 
> > > > }
> > > > 
> > > > 
> > > > What is wrong? What should be changed?
> > > > 
> > > > Many regards,
> > > 

Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrea Biasillo
Hi Andrus!

I think the problem is related to our EntitySorter implementation. Something 
has been changed  in 4.2 with EntitySorter.

Many regards,
Andrea

On 2020/06/29 09:45:03, Andrea Biasillo  wrote: 
> Hi Andrus!
> 
> I will provide the code soon as possible.
> 
> Many thanks 
> 
> On 2020/06/29 09:23:27, Andrus Adamchik  wrote: 
> > Could you send a Cayenne query example where this happens? 
> > 
> > Andrus
> > 
> > 
> > > On Jun 29, 2020, at 12:20 PM, Andrea Biasillo  wrote:
> > > 
> > > Hi Andrus!
> > > 
> > > I think our DataloyOracleAdapter  is in use, at startup in the Wildfly 
> > > log we get this:
> > > 
> > > [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool -- 
> > > 87) Detected and installed adapter: 
> > > com.dataloy.platform.DataloyOracleAdapter
> > > 
> > > Also another thing is the the method setJdbcObject is invoked, but not 
> > > materializeObject
> > > 
> > > Regards,
> > > Andrea
> > > 
> > > On 2020/06/29 08:35:05, Andrus Adamchik  wrote: 
> > >> Here is another random idea - could you verify that your adapter is in 
> > >> use? 
> > >> 
> > >> Andrus
> > >> 
> > >>> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  wrote:
> > >>> 
> > >>> Hi Andrus and thank you!
> > >>> 
> > >>> I tried to override configureExtendedTypes but still the method 
> > >>> materializeObject is not inoked.
> > >>> 
> > >>> Regards,
> > >>> Andrea
> > >>> 
> > >>> On 2020/06/29 08:19:15, Andrus Adamchik  wrote: 
> >  Hi Andrea,
> >  
> >  "materializeObject" method should still be called of course. When 
> >  registering custom types within the adapter, I'd usually override 
> >  "configureExtendedTypes":
> >  
> >  @Override
> >  protected void configureExtendedTypes(ExtendedTypeMap map) {
> >    super.configureExtendedTypes(map);
> >    map.registerType(new SourceIdType());
> >  }
> >  
> >  I suspect it might make a difference, considering somewhat complicated 
> >  type override rules in the adapter.
> >  
> >  Andrus
> >  
> >  
> > > On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  
> > > wrote:
> > > 
> > > Hi!
> > > 
> > > We are migrating from 4.0.2 to 4.2. We have a class that implements 
> > > ExtendedType. 
> > > In 4.0.2 the method:
> > > 
> > > public SourceId materializeObject(ResultSet rs, int index, int type) 
> > > throws Exception 
> > > 
> > > was invoked, but not in 4.2.
> > > 
> > > We register our class in this way:
> > > 
> > > public class DataloyOracleAdapter extends OracleAdapter {
> > > 
> > >   public DataloyOracleAdapter(@Inject RuntimeProperties 
> > > runtimeProperties, 
> > >   @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> > > List defaultExtendedTypes,
> > >   @Inject(Constants.SERVER_USER_TYPES_LIST) 
> > > List userExtendedTypes, 
> > >   @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> > > List extendedTypeFactories,
> > >   @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> > > ResourceLocator resourceLocator, 
> > >   @Inject ValueObjectTypeRegistry 
> > > valueObjectTypeRegistry) {
> > >   super(runtimeProperties, defaultExtendedTypes, 
> > > userExtendedTypes, extendedTypeFactories, resourceLocator,
> > >   valueObjectTypeRegistry);
> > >   setSupportsGeneratedKeys(false);
> > >   //super.setPkGenerator(new DataloyPkGenerator());
> > >   
> > >   setSupportsBatchUpdates(false);
> > >   this.extendedTypes.registerType(new SourceIdType());
> > >   }
> > > 
> > > 
> > > }
> > > 
> > > 
> > > What is wrong? What should be changed?
> > > 
> > > Many regards,
> > > Andrea
> >  
> >  
> > >> 
> > >> 
> > 
> > 
> 


Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrea Biasillo
Hi Andrus!

I will provide the code soon as possible.

Many thanks 

On 2020/06/29 09:23:27, Andrus Adamchik  wrote: 
> Could you send a Cayenne query example where this happens? 
> 
> Andrus
> 
> 
> > On Jun 29, 2020, at 12:20 PM, Andrea Biasillo  wrote:
> > 
> > Hi Andrus!
> > 
> > I think our DataloyOracleAdapter  is in use, at startup in the Wildfly log 
> > we get this:
> > 
> > [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool -- 87) 
> > Detected and installed adapter: com.dataloy.platform.DataloyOracleAdapter
> > 
> > Also another thing is the the method setJdbcObject is invoked, but not 
> > materializeObject
> > 
> > Regards,
> > Andrea
> > 
> > On 2020/06/29 08:35:05, Andrus Adamchik  wrote: 
> >> Here is another random idea - could you verify that your adapter is in 
> >> use? 
> >> 
> >> Andrus
> >> 
> >>> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  wrote:
> >>> 
> >>> Hi Andrus and thank you!
> >>> 
> >>> I tried to override configureExtendedTypes but still the method 
> >>> materializeObject is not inoked.
> >>> 
> >>> Regards,
> >>> Andrea
> >>> 
> >>> On 2020/06/29 08:19:15, Andrus Adamchik  wrote: 
>  Hi Andrea,
>  
>  "materializeObject" method should still be called of course. When 
>  registering custom types within the adapter, I'd usually override 
>  "configureExtendedTypes":
>  
>  @Override
>  protected void configureExtendedTypes(ExtendedTypeMap map) {
>    super.configureExtendedTypes(map);
>    map.registerType(new SourceIdType());
>  }
>  
>  I suspect it might make a difference, considering somewhat complicated 
>  type override rules in the adapter.
>  
>  Andrus
>  
>  
> > On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  wrote:
> > 
> > Hi!
> > 
> > We are migrating from 4.0.2 to 4.2. We have a class that implements 
> > ExtendedType. 
> > In 4.0.2 the method:
> > 
> > public SourceId materializeObject(ResultSet rs, int index, int type) 
> > throws Exception 
> > 
> > was invoked, but not in 4.2.
> > 
> > We register our class in this way:
> > 
> > public class DataloyOracleAdapter extends OracleAdapter {
> > 
> > public DataloyOracleAdapter(@Inject RuntimeProperties 
> > runtimeProperties, 
> > @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> > List defaultExtendedTypes,
> > @Inject(Constants.SERVER_USER_TYPES_LIST) 
> > List userExtendedTypes, 
> > @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> > List extendedTypeFactories,
> > @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> > ResourceLocator resourceLocator, 
> > @Inject ValueObjectTypeRegistry 
> > valueObjectTypeRegistry) {
> > super(runtimeProperties, defaultExtendedTypes, 
> > userExtendedTypes, extendedTypeFactories, resourceLocator,
> > valueObjectTypeRegistry);
> > setSupportsGeneratedKeys(false);
> > //super.setPkGenerator(new DataloyPkGenerator());
> > 
> > setSupportsBatchUpdates(false);
> > this.extendedTypes.registerType(new SourceIdType());
> > }
> > 
> > 
> > }
> > 
> > 
> > What is wrong? What should be changed?
> > 
> > Many regards,
> > Andrea
>  
>  
> >> 
> >> 
> 
> 


Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrus Adamchik
Could you send a Cayenne query example where this happens? 

Andrus


> On Jun 29, 2020, at 12:20 PM, Andrea Biasillo  wrote:
> 
> Hi Andrus!
> 
> I think our DataloyOracleAdapter  is in use, at startup in the Wildfly log we 
> get this:
> 
> [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool -- 87) 
> Detected and installed adapter: com.dataloy.platform.DataloyOracleAdapter
> 
> Also another thing is the the method setJdbcObject is invoked, but not 
> materializeObject
> 
> Regards,
> Andrea
> 
> On 2020/06/29 08:35:05, Andrus Adamchik  wrote: 
>> Here is another random idea - could you verify that your adapter is in use? 
>> 
>> Andrus
>> 
>>> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  wrote:
>>> 
>>> Hi Andrus and thank you!
>>> 
>>> I tried to override configureExtendedTypes but still the method 
>>> materializeObject is not inoked.
>>> 
>>> Regards,
>>> Andrea
>>> 
>>> On 2020/06/29 08:19:15, Andrus Adamchik  wrote: 
 Hi Andrea,
 
 "materializeObject" method should still be called of course. When 
 registering custom types within the adapter, I'd usually override 
 "configureExtendedTypes":
 
 @Override
 protected void configureExtendedTypes(ExtendedTypeMap map) {
   super.configureExtendedTypes(map);
   map.registerType(new SourceIdType());
 }
 
 I suspect it might make a difference, considering somewhat complicated 
 type override rules in the adapter.
 
 Andrus
 
 
> On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  wrote:
> 
> Hi!
> 
> We are migrating from 4.0.2 to 4.2. We have a class that implements 
> ExtendedType. 
> In 4.0.2 the method:
> 
> public SourceId materializeObject(ResultSet rs, int index, int type) 
> throws Exception 
> 
> was invoked, but not in 4.2.
> 
> We register our class in this way:
> 
> public class DataloyOracleAdapter extends OracleAdapter {
> 
>   public DataloyOracleAdapter(@Inject RuntimeProperties 
> runtimeProperties, 
>   @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> List defaultExtendedTypes,
>   @Inject(Constants.SERVER_USER_TYPES_LIST) 
> List userExtendedTypes, 
>   @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> List extendedTypeFactories,
>   @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> ResourceLocator resourceLocator, 
>   @Inject ValueObjectTypeRegistry 
> valueObjectTypeRegistry) {
>   super(runtimeProperties, defaultExtendedTypes, 
> userExtendedTypes, extendedTypeFactories, resourceLocator,
>   valueObjectTypeRegistry);
>   setSupportsGeneratedKeys(false);
>   //super.setPkGenerator(new DataloyPkGenerator());
>   
>   setSupportsBatchUpdates(false);
>   this.extendedTypes.registerType(new SourceIdType());
>   }
> 
> 
> }
> 
> 
> What is wrong? What should be changed?
> 
> Many regards,
> Andrea
 
 
>> 
>> 



Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrea Biasillo
Hi Andrus!

I think our DataloyOracleAdapter  is in use, at startup in the Wildfly log we 
get this:

 [org.apache.cayenne.log.JdbcEventLogger] (ServerService Thread Pool -- 87) 
Detected and installed adapter: com.dataloy.platform.DataloyOracleAdapter

Also another thing is the the method setJdbcObject is invoked, but not 
materializeObject

Regards,
Andrea

On 2020/06/29 08:35:05, Andrus Adamchik  wrote: 
> Here is another random idea - could you verify that your adapter is in use? 
> 
> Andrus
> 
> > On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  wrote:
> > 
> > Hi Andrus and thank you!
> > 
> > I tried to override configureExtendedTypes but still the method 
> > materializeObject is not inoked.
> > 
> > Regards,
> > Andrea
> > 
> > On 2020/06/29 08:19:15, Andrus Adamchik  wrote: 
> >> Hi Andrea,
> >> 
> >> "materializeObject" method should still be called of course. When 
> >> registering custom types within the adapter, I'd usually override 
> >> "configureExtendedTypes":
> >> 
> >> @Override
> >> protected void configureExtendedTypes(ExtendedTypeMap map) {
> >>super.configureExtendedTypes(map);
> >>map.registerType(new SourceIdType());
> >> }
> >> 
> >> I suspect it might make a difference, considering somewhat complicated 
> >> type override rules in the adapter.
> >> 
> >> Andrus
> >> 
> >> 
> >>> On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  wrote:
> >>> 
> >>> Hi!
> >>> 
> >>> We are migrating from 4.0.2 to 4.2. We have a class that implements 
> >>> ExtendedType. 
> >>> In 4.0.2 the method:
> >>> 
> >>> public SourceId materializeObject(ResultSet rs, int index, int type) 
> >>> throws Exception 
> >>> 
> >>> was invoked, but not in 4.2.
> >>> 
> >>> We register our class in this way:
> >>> 
> >>> public class DataloyOracleAdapter extends OracleAdapter {
> >>> 
> >>>   public DataloyOracleAdapter(@Inject RuntimeProperties 
> >>> runtimeProperties, 
> >>>   @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> >>> List defaultExtendedTypes,
> >>>   @Inject(Constants.SERVER_USER_TYPES_LIST) 
> >>> List userExtendedTypes, 
> >>>   @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> >>> List extendedTypeFactories,
> >>>   @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> >>> ResourceLocator resourceLocator, 
> >>>   @Inject ValueObjectTypeRegistry 
> >>> valueObjectTypeRegistry) {
> >>>   super(runtimeProperties, defaultExtendedTypes, 
> >>> userExtendedTypes, extendedTypeFactories, resourceLocator,
> >>>   valueObjectTypeRegistry);
> >>>   setSupportsGeneratedKeys(false);
> >>>   //super.setPkGenerator(new DataloyPkGenerator());
> >>>   
> >>>   setSupportsBatchUpdates(false);
> >>>   this.extendedTypes.registerType(new SourceIdType());
> >>>   }
> >>> 
> >>> 
> >>> }
> >>> 
> >>> 
> >>> What is wrong? What should be changed?
> >>> 
> >>> Many regards,
> >>> Andrea
> >> 
> >> 
> 
> 


Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrus Adamchik
Here is another random idea - could you verify that your adapter is in use? 

Andrus

> On Jun 29, 2020, at 11:27 AM, Andrea Biasillo  wrote:
> 
> Hi Andrus and thank you!
> 
> I tried to override configureExtendedTypes but still the method 
> materializeObject is not inoked.
> 
> Regards,
> Andrea
> 
> On 2020/06/29 08:19:15, Andrus Adamchik  wrote: 
>> Hi Andrea,
>> 
>> "materializeObject" method should still be called of course. When 
>> registering custom types within the adapter, I'd usually override 
>> "configureExtendedTypes":
>> 
>> @Override
>> protected void configureExtendedTypes(ExtendedTypeMap map) {
>>super.configureExtendedTypes(map);
>>map.registerType(new SourceIdType());
>> }
>> 
>> I suspect it might make a difference, considering somewhat complicated type 
>> override rules in the adapter.
>> 
>> Andrus
>> 
>> 
>>> On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  wrote:
>>> 
>>> Hi!
>>> 
>>> We are migrating from 4.0.2 to 4.2. We have a class that implements 
>>> ExtendedType. 
>>> In 4.0.2 the method:
>>> 
>>> public SourceId materializeObject(ResultSet rs, int index, int type) throws 
>>> Exception 
>>> 
>>> was invoked, but not in 4.2.
>>> 
>>> We register our class in this way:
>>> 
>>> public class DataloyOracleAdapter extends OracleAdapter {
>>> 
>>> public DataloyOracleAdapter(@Inject RuntimeProperties 
>>> runtimeProperties, 
>>> @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
>>> List defaultExtendedTypes,
>>> @Inject(Constants.SERVER_USER_TYPES_LIST) 
>>> List userExtendedTypes, 
>>> @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
>>> List extendedTypeFactories,
>>> @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
>>> ResourceLocator resourceLocator, 
>>> @Inject ValueObjectTypeRegistry 
>>> valueObjectTypeRegistry) {
>>> super(runtimeProperties, defaultExtendedTypes, 
>>> userExtendedTypes, extendedTypeFactories, resourceLocator,
>>> valueObjectTypeRegistry);
>>> setSupportsGeneratedKeys(false);
>>> //super.setPkGenerator(new DataloyPkGenerator());
>>> 
>>> setSupportsBatchUpdates(false);
>>> this.extendedTypes.registerType(new SourceIdType());
>>> }
>>> 
>>> 
>>> }
>>> 
>>> 
>>> What is wrong? What should be changed?
>>> 
>>> Many regards,
>>> Andrea
>> 
>> 



Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrea Biasillo
Hi Andrus and thank you!

I tried to override configureExtendedTypes but still the method 
materializeObject is not inoked.

Regards,
Andrea

On 2020/06/29 08:19:15, Andrus Adamchik  wrote: 
> Hi Andrea,
> 
> "materializeObject" method should still be called of course. When registering 
> custom types within the adapter, I'd usually override 
> "configureExtendedTypes":
> 
> @Override
> protected void configureExtendedTypes(ExtendedTypeMap map) {
> super.configureExtendedTypes(map);
> map.registerType(new SourceIdType());
> }
> 
> I suspect it might make a difference, considering somewhat complicated type 
> override rules in the adapter.
> 
> Andrus
> 
> 
> > On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  wrote:
> > 
> > Hi!
> > 
> > We are migrating from 4.0.2 to 4.2. We have a class that implements 
> > ExtendedType. 
> > In 4.0.2 the method:
> > 
> > public SourceId materializeObject(ResultSet rs, int index, int type) throws 
> > Exception 
> > 
> > was invoked, but not in 4.2.
> > 
> > We register our class in this way:
> > 
> > public class DataloyOracleAdapter extends OracleAdapter {
> > 
> > public DataloyOracleAdapter(@Inject RuntimeProperties 
> > runtimeProperties, 
> > @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> > List defaultExtendedTypes,
> > @Inject(Constants.SERVER_USER_TYPES_LIST) 
> > List userExtendedTypes, 
> > @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> > List extendedTypeFactories,
> > @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> > ResourceLocator resourceLocator, 
> > @Inject ValueObjectTypeRegistry 
> > valueObjectTypeRegistry) {
> > super(runtimeProperties, defaultExtendedTypes, 
> > userExtendedTypes, extendedTypeFactories, resourceLocator,
> > valueObjectTypeRegistry);
> > setSupportsGeneratedKeys(false);
> > //super.setPkGenerator(new DataloyPkGenerator());
> > 
> > setSupportsBatchUpdates(false);
> > this.extendedTypes.registerType(new SourceIdType());
> > }
> > 
> > 
> > }
> > 
> > 
> > What is wrong? What should be changed?
> > 
> > Many regards,
> > Andrea
> 
> 


Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrus Adamchik
Hi Andrea,

"materializeObject" method should still be called of course. When registering 
custom types within the adapter, I'd usually override "configureExtendedTypes":

@Override
protected void configureExtendedTypes(ExtendedTypeMap map) {
super.configureExtendedTypes(map);
map.registerType(new SourceIdType());
}

I suspect it might make a difference, considering somewhat complicated type 
override rules in the adapter.

Andrus


> On Jun 29, 2020, at 11:04 AM, Andrea Biasillo  wrote:
> 
> Hi!
> 
> We are migrating from 4.0.2 to 4.2. We have a class that implements 
> ExtendedType. 
> In 4.0.2 the method:
> 
> public SourceId materializeObject(ResultSet rs, int index, int type) throws 
> Exception 
> 
> was invoked, but not in 4.2.
> 
> We register our class in this way:
> 
> public class DataloyOracleAdapter extends OracleAdapter {
> 
>   public DataloyOracleAdapter(@Inject RuntimeProperties 
> runtimeProperties, 
>   @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
> List defaultExtendedTypes,
>   @Inject(Constants.SERVER_USER_TYPES_LIST) 
> List userExtendedTypes, 
>   @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
> List extendedTypeFactories,
>   @Inject(Constants.SERVER_RESOURCE_LOCATOR) 
> ResourceLocator resourceLocator, 
>   @Inject ValueObjectTypeRegistry 
> valueObjectTypeRegistry) {
>   super(runtimeProperties, defaultExtendedTypes, 
> userExtendedTypes, extendedTypeFactories, resourceLocator,
>   valueObjectTypeRegistry);
>   setSupportsGeneratedKeys(false);
>   //super.setPkGenerator(new DataloyPkGenerator());
>   
>   setSupportsBatchUpdates(false);
>   this.extendedTypes.registerType(new SourceIdType());
>   }
> 
> 
> }
> 
> 
> What is wrong? What should be changed?
> 
> Many regards,
> Andrea



problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrea Biasillo
Hi!

We are migrating from 4.0.2 to 4.2. We have a class that implements 
ExtendedType. 
In 4.0.2 the method:

public SourceId materializeObject(ResultSet rs, int index, int type) throws 
Exception 

was invoked, but not in 4.2.

We register our class in this way:

public class DataloyOracleAdapter extends OracleAdapter {

public DataloyOracleAdapter(@Inject RuntimeProperties 
runtimeProperties, 
@Inject(Constants.SERVER_DEFAULT_TYPES_LIST) 
List defaultExtendedTypes,
@Inject(Constants.SERVER_USER_TYPES_LIST) 
List userExtendedTypes, 
@Inject(Constants.SERVER_TYPE_FACTORIES_LIST) 
List extendedTypeFactories,
@Inject(Constants.SERVER_RESOURCE_LOCATOR) 
ResourceLocator resourceLocator, 
@Inject ValueObjectTypeRegistry 
valueObjectTypeRegistry) {
super(runtimeProperties, defaultExtendedTypes, 
userExtendedTypes, extendedTypeFactories, resourceLocator,
valueObjectTypeRegistry);
setSupportsGeneratedKeys(false);
//super.setPkGenerator(new DataloyPkGenerator());

setSupportsBatchUpdates(false);
this.extendedTypes.registerType(new SourceIdType());
}


}


What is wrong? What should be changed?

Many regards,
Andrea