SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: GAE Unmarshalling doesn't work for a Set of domainobjects

This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 17 - Pages: 2 [ 1 2 | Next ] - Last Post: Dec 3, 2011 4:23 AM Last Post By: woolrich
kilic

Posts: 2
Registered: 2/9/10
GAE Unmarshalling doesn't work for a Set of domainobjects
Posted: Feb 9, 2010 2:40 PM
 
  Click to reply to this thread Reply
Hey all,

I'm using compass-2.3.0-beta1.jar with GAE. My domainobject are mapped with JDO, here is an simplified version of it:

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
@Searchable
public class Customer {
 
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @SearchableId
    private Long id;
 
    @Persistent
    @SearchableProperty(name = "customerName")
    private String name;
	
    @Persistent
    @Element(dependent = "true")
    @SearchableReference(cascade = Cascade.ALL, refAlias = "account")
    private Set<Account> accounts;
	
    @Persistent
    @SearchableProperty
    private Set<String> testSet;
}


@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
@Searchable(alias = "account")
public class Account {
	
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @SearchableId(converter = "keyConverter")
    private Key key;
	
    @Persistent
    @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
    private String customerId;
	
    @Persistent
    @SearchableProperty(name = "accountName")
    private String name;
}


My PMS (;-)) code looks like this:

static {
    	compass = new CompassConfiguration()
    		.setConnection("gae://index")
	    	.setSetting(CompassEnvironment.ExecutorManager.EXECUTOR_MANAGER_TYPE, "disabled")
// KeyConverter taken from [http://issues.compass-project.org/browse/CMP-886]
	    	.registerConverter("keyConverter", Key.class, new KeyConverter())
	    	.addScan("com.keskinkilic.domain")
	    	.buildCompass();
    	
    	compassGps = new SingleCompassGps(compass);
    	compassGps.addGpsDevice(new Jdo2GpsDevice("appengine", pmfInstance));
 
    	if (compass.getSearchEngineIndexManager().isLocked())
            compass.getSearchEngineIndexManager().releaseLocks();
 
    	compassGps.start();    	
    	compassGps.index();
}


The code to perform the query is very simple and looks like this:

public List<Customer getCustomers(String query) {
    CompassSearchSession ss = PMF.getCompass().openSearchSession();
    CompassHits hits = ss.find(query);
 
    List<Customer> customers = new ArrayList<Customer>();
    for (int i=0; i<hits.length(); i++)
        customers.add((Customer)hits.data(i));
 
    ss.close();
 
    return customers;
}


The result of this method is exactly what I expect it to be, all SearchableProperties of the Customers are filled correctly. Only the accounts (Set<Accout>) property has a null value. I tried some everything: annotating it with SearchableReference, SearchableComponent, making the Account class a non-root Searchable, setting an explicit refAlias but the value is still a null value. The strange thing is that the testSet (Set<String>) works correctly, so it seems to be something in the unmarshalling part of Compass.

Is it a bug in Compass/GAE (it's still a beta) or did I overlook something?

Please help me, thanks in advance!

keskinkilic

Edited by: kilic on Feb 9, 2010 2:43 PM (added some codeblocks)

Edited by: kilic on Feb 9, 2010 2:45 PM

Edited by: kilic on Feb 10, 2010 3:20 PM
kilic

Posts: 2
Registered: 2/9/10
Re: GAE Unmarshalling doesn't work for a Set of domainobjects
Posted: Feb 10, 2010 4:37 PM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply
After testing my code a bit more, I realized that the accounts field also not filled when quering with JDO PersistenceManager.
The following annotation on the accounts field did the trick:

@Persistent(defaultFetchGroup = "true")

WIth this annotation the accounts property is always filled directly.

Anyway thanks for listening :-)

Edited by: kilic on Feb 10, 2010 4:37 PM
lvzeng

Posts: 268
Registered: 11/13/11
louis vuitton
Posted: Nov 13, 2011 8:13 PM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply
Owning

louis vuitton bags

of their own has been the dreams of many fad-seeking people for a quite long time.
You need not worry about the quality of the

coach outlet store online

for sale now. The Coach brand is famous for the perfect products.
I am so confused that I don,t even know where to buy the

louis vuitton

Handbags. Because I can prefer to chose the fashionable design, favorable price, top service .

coach outlet store online

with fashion style and top quality succeed. In any occasions they are very suitable and appropriate for its precise and rich design.
They're not chosen, so one of these ideal for you.For more flexibleness a lot more like these, there are lots of discount 'shoulder' variations outlet

louis vuitton bags

.

hermes birkin

is an Austrian success story par excellence. At the end of the 19th century Daniel Swarovski founded a company with the aim to cut crystals automatically.

coach outlet store

vision system is a visual enjoy, is a visual art. The particular design has been integrated function and the element of elegancy, then show you an exquisite and excellent product.
jenny

Posts: 271
Registered: 11/13/11
coach outlet store online
Posted: Nov 13, 2011 8:34 PM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply
The

coach factory outlet

has been in business for many years. You can log in to find more information about its products and services.
At

louis vuitton sale

,you will find Louis Vuitton Vernis Wallet uses Vernis leather lining instead of classic Monogram canvas, meanwhile creates another classic style with fashion.
Here's your new way to look sophisticated styles. Carry the hot

coach outlet store online

of this summer and be the true trendsetter!
Several days ago, I chose one style of

hermes scarf

from the Swarovski Outlets, which has won good reputation from many customers.
It is a symbol regarding position not to mention nature, Here I would like to launch a excellent bags pertaining to business men, which may be

louis vuitton online

Cupertino M56398.
Almost everyone has identified effectively about this, below, among the best to make sure you will get much more information about

coach outlet

.
coach8outlet

Posts: 282
Registered: 11/13/11
Re: GAE Unmarshalling doesn't work for a Set of domainobjects
Posted: Nov 14, 2011 2:13 AM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply

louis vuitton handbags

enjoy high reputation all over the world. They are designed for hand, elbow and shoulder carry thanks to comfortable flat leather handles.
If you have been to the mall lately and browsed

coach outlet

you may find that a high price tag goes along with just about everything in the mall.
This client-oriented and faith-rooted store aims at providing the best LV goods and services, such as top-class

louis vuitton uk

and free shipping.
Turn your attention to such discount coach sneakers for women from Coach Outlet Store online, you will find something unique and special of such authentic coach for sale at coach factory outlet store online.

louis vuitton outlet

online just like a person who want to show himself in front of other people, because he is confident enough, he can attain the respect of other people.
Bezel-set

hermes birkin bag

are showcased in all their brilliance in the chic and timeless design of this tennis bracelet. Rhodium-plated metal bracelet with foldover clasp.
The

coach outlet store online

are utilized for formal event in company area that will display your excellent taste.Not only does a briefcase make is easier to carry things.
tonnyben

Posts: 270
Registered: 11/14/11
Re: Spring inheritance, lazy-init with Compass namespace?
Posted: Nov 14, 2011 2:52 AM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply

coach factory outlet online

featured with stylish leather bags and signature materials, and carry this bag, it can designate people seem to be captivatingly feminine and good-looking. Why not to buy one when it is at an affordable price?
The products that

louis vuitton outlet

is countless, such as: purses, bags, handbags, shoes, belt. Even the same kind of product includes the products for women, the products for men, for summer-day use, for winter-day use.So, it is probably far beyond your imagination.
As a perfect combination of classic and modern fashion,

coach outlet online

can show the customers'unique personality.

hermes birkin

is your premier online shop for a wide range of quality Swarovski Crystal products such as Swarovski Crystals earring, Jewelry, Bracelet etc.
You could find them in desirable quality and price. If you don't mind high class louis vuitton replica bags, have a good time at

louis vuitton outlet online

.

coach purses

tend to be among finest style strikes associated with these days! They're the standing image that many ladies possess, or even, intend on obtaining.
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: GAE Unmarshalling doesn't work for a Set of domainobjects
Posted: Nov 17, 2011 2:46 AM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply
China voiced

Coach Factory Outlet

misgivings about Obama's announcement

Coach Factory Store

of a de facto military base in Australia a

Coach Outlet

nd has longstanding fears that its growing power could be hobbled by U.S. influence.
Obama ac

Coach Outlet

knowledged China's unease at what it sees as attempts by

Coach Outlet Online

Washington to encircle it,

Coach Outlet

pledging to seek greater cooperation with Beijing.
The U.S. military,

Coach Outlet Online

turning its focus away from Iraq and Afghanistan, would be more broadly distributed in Asia, particularly Southeast Asia, more flexible and help build regional

Chanel Outlet

capacity, he told the Australian parliament.
"As we end today'

Chanel Outlet

s wars, I have directed my national security team to

Louis Vuitton Outlet

make our presence and missions in the Asia Pacific a top priority," Obama said in a major speech on Washington's vision for the Asia-Pacific region.
clothworld

Posts: 1,130
Registered: 11/16/11
Belstaff Jackets
Posted: Nov 22, 2011 6:24 PM   in response to: kilic in response to: kilic
 
  Click to reply to this thread Reply
The us government has revoked the whole 2008 Belstaff Jackets governmental assistance "Building Sturdy, Safe Belstaff Leather Jackets and sound and also Profitable Online communities", including basic Belstaff Uk Affordable guidance on commission. As well as summary of that fresh Affordable Direction reiterates the Government's Belstaff Bags objective to be able to annul the statutory jobs to ready a Maintainable Group Method as well as Duty Belstaff Womens Jackets to see, Consult & Call for.
For any folks invested in more and better resident contribution, that is a knock back, i believe.
But strangely enough, the newest one-pager Can involve many responsibilities around consultation.
Very first, this Assistance definitely makes the next point:
"To own proper sense of balance–plus in advance Belstaff Coats of coming to a decision how you can complete their full capacity Cost Job– specialists they are under some sort of Accountability to refer to officials Belstaff Mens Blouson of your wide range of neighborhood persons; that isn't optionally available. Government bodies ought to confer with officials with authorities tax payers, those who utilize or maybe are likely to work with services offered by your guru, and those listed towards the power to get an desire for almost any location in how the expert carries Belstaff Mens Jackets out capabilities. Belstaff Sale Government bodies will include neighborhood volunteer and also neighborhood companies plus business owners such assessment. Belstaff Jacket This would implement at all stages of the commissioning period, which include when it comes to the actual decommissioning associated with providers."
This references the particular 2000 County Respond Belstaff Womens Blouson Segment three Part only two, which will states:nterestingly, the revolutionary Best Value Direction subsequently goes on to state firmly with regard to regional consultation primarily with budgetary issues in hard periods.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums