mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-06 21:05:50 +08:00
improved Q-type serialization
This commit is contained in:
parent
53210d85a0
commit
86981cea17
@ -90,7 +90,7 @@ class ScalaEntitySerializer @Inject()(val typeMappings: TypeMappings) extends Se
|
||||
writer.beginObject(queryTypeName)
|
||||
writer.line("def as(variable: String) = new ", queryTypeName, "(variable)")
|
||||
writer.line("")
|
||||
writer.line("val ", model.getUncapSimpleName, " = new ", queryTypeName, "(\"", model.getUncapSimpleName, "\")")
|
||||
writer.line("val ", model.getUncapSimpleName, " = as \"", model.getUncapSimpleName, "\"")
|
||||
writer.end()
|
||||
|
||||
// header
|
||||
|
||||
@ -12,29 +12,29 @@ import com.mysema.query.scala.sql.RelationalPathImpl;
|
||||
import com.mysema.query.sql._;
|
||||
|
||||
object QEmployee {
|
||||
def as(variable: String) = new QEmployee(variable)
|
||||
def as(variable: String) = new QEmployee(variable)
|
||||
}
|
||||
|
||||
@Table("EMPLOYEE")
|
||||
@Schema("PUBLIC")
|
||||
class QEmployee(cl: Class[_ <: Employee], md: PathMetadata[_]) extends RelationalPathImpl[Employee](cl, md) {
|
||||
def this(variable: String) = this(classOf[Employee], forVariable(variable));
|
||||
def this(variable: String) = this(classOf[Employee], forVariable(variable));
|
||||
|
||||
def this(parent: Path[_], variable: String) = this(classOf[Employee], forProperty(parent, variable));
|
||||
def this(parent: Path[_], variable: String) = this(classOf[Employee], forProperty(parent, variable));
|
||||
|
||||
val firstname = createString("FIRSTNAME");
|
||||
val firstname = createString("FIRSTNAME");
|
||||
|
||||
val id = createNumber("ID", classOf[Integer]);
|
||||
val id = createNumber("ID", classOf[Integer]);
|
||||
|
||||
val lastname = createString("LASTNAME");
|
||||
val lastname = createString("LASTNAME");
|
||||
|
||||
val superiorId = createNumber("SUPERIOR_ID", classOf[Integer]);
|
||||
val superiorId = createNumber("SUPERIOR_ID", classOf[Integer]);
|
||||
|
||||
val sysIdx55: PrimaryKey[Employee] = createPrimaryKey(id);
|
||||
val sysIdx55: PrimaryKey[Employee] = createPrimaryKey(id);
|
||||
|
||||
val superiorFk: ForeignKey[Employee] = createForeignKey(superiorId, "ID");
|
||||
val superiorFk: ForeignKey[Employee] = createForeignKey(superiorId, "ID");
|
||||
|
||||
val _superiorFk: ForeignKey[Employee] = createInvForeignKey(id, "SUPERIOR_ID");
|
||||
val _superiorFk: ForeignKey[Employee] = createInvForeignKey(id, "SUPERIOR_ID");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -12,21 +12,21 @@ import com.mysema.query.scala.sql.RelationalPathImpl;
|
||||
import com.mysema.query.sql._;
|
||||
|
||||
object QSurvey {
|
||||
def as(variable: String) = new QSurvey(variable)
|
||||
def as(variable: String) = new QSurvey(variable)
|
||||
}
|
||||
|
||||
@Table("SURVEY")
|
||||
@Schema("PUBLIC")
|
||||
class QSurvey(cl: Class[_ <: Survey], md: PathMetadata[_]) extends RelationalPathImpl[Survey](cl, md) {
|
||||
def this(variable: String) = this(classOf[Survey], forVariable(variable));
|
||||
def this(variable: String) = this(classOf[Survey], forVariable(variable));
|
||||
|
||||
def this(parent: Path[_], variable: String) = this(classOf[Survey], forProperty(parent, variable));
|
||||
def this(parent: Path[_], variable: String) = this(classOf[Survey], forProperty(parent, variable));
|
||||
|
||||
val id = createNumber("ID", classOf[Integer]);
|
||||
val id = createNumber("ID", classOf[Integer]);
|
||||
|
||||
val name = createString("NAME");
|
||||
val name = createString("NAME");
|
||||
|
||||
val sysIdx54: PrimaryKey[Survey] = createPrimaryKey(id, name);
|
||||
val sysIdx54: PrimaryKey[Survey] = createPrimaryKey(id, name);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user