views:

148

answers:

3

Hi,

I'm switching from Scala 2.7.7 to Scala 2.8.0RC3 and now a few of my classes don't compile anymore. The problem is in the @PersistentCapable annotation:

import javax.jdo.annotations._
import java.util.Date

@PersistenceCapable{identityType=IdentityType.APPLICATION}
class Counter(dt: Date, cName: String, vl: int) {
 <.. snip ..> 
}

This code results in the following compilation errors:

[ERROR] /Users/gero/prive/kiva/kivanotify-gae/src/main/scala/net/vermaas/kivanotify/model/LoanProcessed.scala:7: error: expected start of definition
[INFO] @PersistenceCapable{val identityType = IdentityType.APPLICATION}

I already tried a couple of variations, did some Googling but without luck. Any ideas on how I can use the @PersistentCapable annotation with Scala 2.8.0 RC3?

Thanks, Gero

A: 

Did not find a solution that enables me to use the annotations again, but of course you can switch to putting the JDO meta data in an XML file... and that's what I did. Would rather use the annotations, but at least I can continue now.

Gero

Gero
So report the compilation problems to the people developing Scala. It is at compile time, with something that compiles fine in a previous version of Scala ... therefore the issue is almost certainly with them
DataNucleus
+1  A: 

The syntax has changed in 2.8, you should use named arguments:

@Table(name = "projects")
class Project(name: String) {
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  var id: Int = _
}

http://scala-programming-language.1934581.n4.nabble.com/JPA-annotations-fails-when-using-2-8-beta-also-rc2-td1935831.html

Phil
A: 

Try @PersistenceCapable(identityType = IdentityType.APPLICATION)

Note (), rather than {}

NeilF