- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Default field annotation?
Thu, 2010-07-29, 11:33
Hi all,
I have a little problem with scala 2.8.0 (I used 2.8.0.beta before)
I have the following Hibernate entity case class:
@Entitycase class Test(
@Id val id: Long = 0l) extends Serializable { def this() = this(0l)}
I 2.8.0.beta this worked perfect, because the annotations are attached to the private field (so no need for getter/setter methods for Hibernate).Now with 2.8.0 Hibernate throws an AnnotationException saying; "No identifier specified for entity"and so I have to explicitly tell scala to annotate the field:
@Entitycase class Test(
@(Id @field) val id: Long = 0l) extends Serializable { def this() = this(0l)}
Is this the expected behavior?The documentation http://www.scala-lang.org/sid/5 seems to say that by default the field should be annotated!
Thanks for replies/help
Roll
I have a little problem with scala 2.8.0 (I used 2.8.0.beta before)
I have the following Hibernate entity case class:
@Entitycase class Test(
@Id val id: Long = 0l) extends Serializable { def this() = this(0l)}
I 2.8.0.beta this worked perfect, because the annotations are attached to the private field (so no need for getter/setter methods for Hibernate).Now with 2.8.0 Hibernate throws an AnnotationException saying; "No identifier specified for entity"and so I have to explicitly tell scala to annotate the field:
@Entitycase class Test(
@(Id @field) val id: Long = 0l) extends Serializable { def this() = this(0l)}
Is this the expected behavior?The documentation http://www.scala-lang.org/sid/5 seems to say that by default the field should be annotated!
Thanks for replies/help
Roll