Compiling annotations with inconsistant behavior [message #334182] |
Fri, 23 January 2009 12:35  |
Eclipse User |
|
|
|
Consider the following code scenerios...
// Case 1
// Code shows error in eclipse
@MappedSuperclass
class Parent
{
public static final String TABLE = "PARENT";
public static final InheritanceType INH = InheritanceType.SINGLE_TABLE;
...
}
@Entity
@Table(name=Parent.TABLE) <<< Works fine
@Inheritance(strategy=Parent.INH) <<< ERROR, requires enum constant
class Child extends Parent
{
...
}
// Case 2
// Code shows no error in eclipse
// But fails to compile via command line using say maven
@MappedSuperclass
class Parent
{
public static final String TABLE = "PARENT";
public static final int INH = 0;
...
}
@Entity
@Table(name=Parent.TABLE) <<< Works fine everywhere
@Inheritance(strategy = Parent.INH == 0
? InheritanceType.X
: InheritanceType.Y) <<< NO ERROR in eclipse
class Child extends Parent
{
...
}
The latter case fails compile time via maven with the same error as
before, that the annotation requires an enum constant value for
Inheritance.
Why does eclipse have an inconsistant behvaior in that case?
I am using Ganymede and JDK 1.6 (however same behavior seen with JDK 1.5)
Thanks.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11456 seconds