Unindexed Embedded class

18 views
Skip to first unread message

Tomas

unread,
Oct 4, 2011, 5:13:48 AM10/4/11
to Google App Engine
I am trying to set my embedded classes to unindexed but seems like it
doesnt work (works for normal/direct attributes though). Similar issue
is here: http://groups.google.com/group/google-appengine-java/browse_thread/thread/3a92afabfd2b6ac2

@PersistenceCapable
@EmbeddedOnly
public class Embedded {

@Persistent
@Extension(vendorName="datanucleus", key="gae.unindexed",
value="true")
private String us;

}

@PersistenceCapable
public class Parent
{
@Persistent(defaultFetchGroup = "true")
@Embedded(members = {
@Persistent(name="us", columns=@Column(name="us"),
extensions=@Extension(vendorName="datanucleus", key="gae.unindexed",
value="true")),
})
private Embedded e;
}

I've also tried:

@PersistenceCapable
public class Parent
{
@Persistent(defaultFetchGroup = "true")
@Embedded(members = {
@Persistent(name="us", columns=@Column(name="us"))
@Extension(vendorName="datanucleus", key="gae.unindexed",
value="true"))
private Embedded e;
}

Bit didn't work neither.

Is this a bug/feature or am I missing something?

Gerald Tan

unread,
Oct 4, 2011, 5:48:18 AM10/4/11
to google-a...@googlegroups.com
I had a similar issue before. Eventually the problem solved itself when I switched to using objectify and simply @Serialized whatever embedded classes I didn't want indexed.

Jeff Schnitzer

unread,
Oct 4, 2011, 1:53:13 PM10/4/11
to google-a...@googlegroups.com
If you're using Objectify's @Embedded classes, you can use @Indexed
and @Unindexed to control indexing - either on the classes or on the
fields. You don't need to use @Serialized for this case... although
@Serialized has other pluses and minuses.

Jeff

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/hM9HPydmMRAJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

Reply all
Reply to author
Forward
0 new messages