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;
}
}