ScalaMetaDataSerializer incorrect placing of @Table annotation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Fix Released
|
High
|
Unassigned |
Bug Description
The ScalaMetaDataSe
=== example code (extracted from a Scala REPL session)
import com.mysema.
import java.sql.
import com.mysema.
import com.mysema.
import java.io.File
import java.util.Arrays
Class.forName(
val dbc = DriverManager.
val namingStrategy = new DefaultNamingSt
val serializer = new ScalaMetaDataSe
val beanSerializer = new ScalaBeanSerial
val exporter = new MetaDataExporte
exporter.
exporter.
===
one of the generated classes looks like this:
===
@Table("feature")
object QFeature {
def as(variable: String) = new QFeature(variable)
}
class QFeature(path: String) extends RelationalPathB
val description: StringPath = createString(
val id: NumberPath[
}
===
The @Table("feature") annotation should be in front of the class definition.
My suggestion would be to simply move the generation of the companion object definition (lines 62 - 64 inclusive in ScalaMetaDataSe
Patch attached.
Thanks for the bug report and patch. I didn't change the order of the companion object and class, but moved the annotations to the class.