title: Generate classes from Postgress database with multiple schemas using Cayenne
body: <p>I have PostgreSQL database with multiple schema and I'm using Apache Cayenne to generate Java classes. Problem is that cayenne skips foreign keys on tables in different schema. Example:</p>
  
  <p>Table <code>schema_b.booking</code> that references <code>schema_a.my_user</code>:</p>
  
  <pre><code>create table schema_b.booking
  (
      id bigserial not null constraint booking_pkey primary key,
      address_id integer not null constraint cde_fk references schema_b.address
      ...,
      created_by integer not null constraint abc_fk references schema_a.my_user
  );
  </code></pre>
  
  <p>Generated Java class looks like:</p>
  
  <pre><code>class Booking {
       private Long id; 
       private Address addressId; //this is OK
       private Integer createdBy; //NOT OK (Integer instead of MyUser)
  }
  </code></pre>
  
  <p>Console log shows this entry for every FK in different schema:</p>
  
  <pre><code>[INFO] Skip relation: 'null.schema_a.my_user.id &lt;- null.schema_b.booking.created_by # 1' because it related to objects from other catalog/schema
  [INFO]      relation primary key: 'null.schema_a'
  [INFO]        primary key entity: 'null.schema_a'
  [INFO]      relation foreign key: 'null.schema_b'
  [INFO]        foreign key entity: 'null.schema_b'
  </code></pre>
  
  <p>The problem is that <code>Booking#createdBy</code> is not <code>MyUser</code>.</p>
  
  <p>I've searched on SO and official documentation, but without success. Is there any way to achieve this? I know that another option is to move all tables into single schema, but that is almost unfeasible for our project.</p>