cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Manuel Diaz Lara <>
Subject Re: How to install my own DbAdapterDetector on 4.0.B2
Date Tue, 13 Feb 2018 01:36:11 GMT
I solved it,for 4.0.B2:
I suppose this method add the new detector to the first place on the list, so It is found
as i want. 

Does  anybody knows why my first approach didn't worked ?

Atte. Juan Manuel Díaz Lara 

    On Monday, February 12, 2018, 7:06:42 PM CST, Juan Manuel Diaz Lara <>
 My code was working on 4.0.M5, but I ca not figure out how to make it work on B2, I think
the problem is that I am not installing my DbAdapterDetector properly.

package com.ace.dba;

import static org.apache.cayenne.configuration.Constants.SERVER_ADAPTER_DETECTORS_LIST;

import org.apache.cayenne.configuration.server.DbAdapterDetector;
import org.apache.cayenne.dba.postgres.PostgresSniffer;
import org.apache.cayenne.di.Binder;
import org.apache.cayenne.di.Module;

public class PcExpressPosModule implements Module {

    public void configure(Binder binder) {
        //4.0.b2:        binder.bindList(DbAdapterDetector.class).insertBefore(PostgresSniffer.class,
PcExpressPosPgDetector.class );  //tryes param in reverse order nothing

My PcExpressPosPgDetector:

public class PcExpressPosPgDetector extends PostgresSniffer {
    public PcExpressPosPgDetector(@Inject AdhocObjectFactory objectFactory) {

    public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
        PostgresAdapter db = (PostgresAdapter) super.createAdapter(md);
        db.setPkGenerator(new PcExpressPosUUIDPkGenerator(db));
        return db;    
PcExpressPosUUIDPkGenerator detects pk columns of type UUID and generates a uuid for then,..
thats all.

Atte. Juan Manuel Díaz Lara  
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message