0

i have defined destination class and some subclasses like region, country, city with some additional fields. i want put all their instances in the same solr core. it works, because i have created the schema with all possible fields(regionName, countryName etc. in the same schema.xml).

but i don't know, how can i fetch them and convert in the correct type? has anyone any idea? or it is not possible?

thanks for your answers,

best regards

shan

the code likes:

Destiantion

@SolrDocument(solrCoreName = "destination")
public class Destination implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 4593263425568053104L;


    private int id;

    private String name;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}

City

public class City extends Destination {

    /**
     * 
     */
    private static final long serialVersionUID = 4593263425568053104L;


    private int regionId;

    private String regionName;

    public int getRegionId() {
        return regionId;
    }

    public void setId(int regionId) {
        this.regionId = regionId;
    }

    public String getRegionName() {
        return regionName;
    }

    public void setName(String regionName) {
        this.regionName = regionName;
    }

}
shan
  • 112
  • 1
  • 9

1 Answers1

0

What kind of a code is this?? You use

 @Field

on top of the fields/methods for no reason.

You write

 Integer

instead of

 int 

in the return type. Dude ar e you trolling or what?

And the answer is NO.

(Had to write NO in case this post gets deleted.) (I believe your post is ridicilious and deserves the answer NO) (That's how it works in stack overflow nowadays.)

Kuantew
  • 134
  • 6