google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

Use @Inherited annotation on Indexed and Unindexed annotations #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Without the @Inherited annotation on the Indexed and Unindexed annotations,  
269 annotation processing function 
EntityElement#getAnnotation(Indexed.class/Unindexed.class) will return null 
when the Indexed or Unindexed annotation has been specified on a class that the 
class extends.

In the following example, objectify-query will determine that value is indexed, 
as generate a filterByValue method.  However objectify will determine that 
value in unindexed, and not create an index. Using filterByValue will fail.

@Unindexed
public abstract class AbstractEntity {
 // ...
}

@Entity
public class MyEntity extends AbstractEntity
   int value;
}

Original issue reported on code.google.com by bren...@doherty.net.nz on 12 Apr 2011 at 11:47

GoogleCodeExporter commented 9 years ago
If possible, can this change be made on the 2.x and 3.x branches.

Original comment by bren...@doherty.net.nz on 12 Apr 2011 at 11:48

GoogleCodeExporter commented 9 years ago
I am confused.  In Ofy2, MyEntity.value will be unindexed (actually, behavior 
was never documented and is therefore undefined).  In Ofy3, MyEntity.value will 
be indexed.

I can understand the desire to have the behavior in v2 and v3 be the same so 
that you can work with both, but this represents a significant amount of work 
to retrofit.  I'd rather just push forward with v3.

Original comment by lhori...@gmail.com on 12 Apr 2011 at 5:42

GoogleCodeExporter commented 9 years ago
Ok, if on Ofy3 the value is Indexed i'm happy with that. 

I'm still on Ofy2 and was experiencing the other behaviour which mean that 
objectify-query was generated methods that would not work. 

Original comment by bren...@doherty.net.nz on 12 Apr 2011 at 7:19

GoogleCodeExporter commented 9 years ago
Flagging this as fixed.  If current behavior is not desired, feel free to 
reopen this issue.

Note that in Objectify4 default is not to index fields.

Original comment by lhori...@gmail.com on 16 Dec 2011 at 2:30