On Wed, Sep 12, 2012 at 9:15 PM, RanUser <
ranu...@gmail.com> wrote:
> Astyanax requires a class with a zero arg constructor, and possibly a
> multi argument class constructor (from what I've read):
>
> class TestCompositeColumn(idIn: Long, key1In: String, key2In: String)
> extends Ordered[TestCompositeColumn] {
> @Component(ordinal = 0) var id: Long = idIn
> @Component(ordinal = 1) var key1: String = key1In
> @Component(ordinal = 2) var key2: String = key2In
>
> def this() = this(0, null, null)
> //equals, hashCode, compare all implemented
> }
It may help to add the @field meta-annotation to make sure the
annotations get applied to the fields, instead of (or in addition to?)
the getters. The syntax is a bit ugly, but this is how you do it:
import annotation.target.field
class Foo {
@(AnnotationWithoutParams @field)
@(AnnotationWithParams @field)(param=value)
guid: String
}
> I also defined an companion object to try to simulate Java static
> newInstance method (newInstance method is never reached, and I'm sure
> I'm doing it wrong):
This doesn't work in Java; newInstance is a non-static method of a
Class, not a static method of a class. :)
-0xe1a