mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
Generate constructor with variable and schema parameters.
This is for the case where each customer has its own database with the same strucure using a single connection. Fixes #1877
This commit is contained in:
parent
a5e39ffa98
commit
717ba28fff
@ -25,6 +25,7 @@ import javax.inject.Named;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.mysema.codegen.CodeWriter;
|
||||
import com.mysema.codegen.model.*;
|
||||
import com.querydsl.codegen.*;
|
||||
@ -110,6 +111,13 @@ public class MetaDataSerializer extends EntitySerializer {
|
||||
+ "forVariable(variable), schema, table);");
|
||||
constructorContent(writer, model);
|
||||
writer.end();
|
||||
|
||||
writer.beginConstructor(new Parameter("variable", Types.STRING),
|
||||
new Parameter("schema", Types.STRING));
|
||||
writer.line(SUPER, "(", writer.getClassConstant(localName) + COMMA
|
||||
+ "forVariable(variable), schema, \"", model.getData().get("table") + "\");");
|
||||
constructorContent(writer, model);
|
||||
writer.end();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user