I'm not sure if this is something I'm doing wrong (quite possible) or if 
there is a problem with the way code is being generated.  Here is an 
example schema:
 
CREATE TABLE dbo.named_id (
  name_id INT IDENTITY,
  name VARCHAR(50)
)
GO
CREATE SCHEMA under10
GO
CREATE VIEW under10.named_id AS 
  SELECT * 
  FROM dbo.named_id
  WHERE name_id < 10
GO
CREATE SCHEMA over10
GO
CREATE VIEW over10.named_id AS 
  SELECT * 
  FROM dbo.named_id
  WHERE name_id > 10
GO
 
The thing to notice is that each schema contains a view with the same name 
and fields as the original table.  This is being done to limit what people 
can see by setting which schema they have access to witout rewritting any 
of the reports.  However, when I generate classes from JOOQ, I'm seeing the 
same fields being repeated there.  In this case, NAME_ID and NAME are 
repeated in the NamedId class (extends TableImpl) and the getters/setters 
are repeated in NamedIdRecord (extends TableRecordImpl).  The repeat count 
is the total number of schemas plus the original table in dbo.  There are 
3 exact copies for the above example schema.
 
In the generator XML I have <inputSchema>dbo</inputSchema> and have 
tried using <includes>dbo\..*</includes> but the code generated is 
unchanged.  This is with versions 2.5.1 and 2.6.0 of JOOQ.
 
My workaround for now is using a copy of the database with the extra 
schemas removed.  Its not an ideal situation, but it does let me continue 
work.  Are there any other ideas that I could try?
 

Reply via email to