Я использую компас с пружиной и гибернацией. Я правильно получаю количество обращений, но в них нет данных
Вот мой класс сущности
@Entity
@Searchable(alias="patient")
public class Patient {
@Id
@GeneratedValue
@SearchableId
public Integer id;
@SearchableProperty(name="name")
public String firstName;
public String lastName;
}
Вот класс действий
public class SearchAction extends ActionSupport {
Compass compass;
CompassGps compassGps;
String query;
CompassHit[] hits;
CompassSearchCommand searchCommand;
CompassSearchResults searchResults;
public String list()
{
if (searchHelper == null) {
searchHelper = new CompassSearchHelper(compass, 10);
}
searchCommand = new CompassSearchCommand(query, 10);
if (!StringUtils.hasText(searchCommand.getQuery())) {
return "LIST";
}
searchResults = searchHelper.search(searchCommand);
hits = searchResults.getHits();
return "RESULTS";
}
}
Вот мое приложение context.xml
<bean id="compass" class="org.compass.spring.LocalCompassBean">
<property name="resourceLocations">
<list>
<value>classpath:medics.cmd.xml</value>
</list>
</property>
<property name="compassConfiguration" ref="annotationConfiguration"/>
<property name="compassSettings">
<props>
<prop key="compass.engine.connection">file:///compass/medics</prop>
<prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
</props>
</property>
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="classMappings">
<list>
<value>com.medics.entities.Appointment</value>
<value>com.medics.entities.Patient</value>
<value>com.medics.entities.Users</value>
</list>
</property>
</bean>
<bean id="hibernateGpsDevice" class="org.compass.gps.device.hibernate.HibernateGpsDevice">
<property name="name"><value>hibernateDevice</value></property>
<property name="sessionFactory"><ref local="sessionFactory" /></property>
<property name="nativeExtractor"><bean class="org.compass.spring.device.hibernate.SpringNativeHibernateExtractor" /></property>
</bean>
<bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps" init-method="start" destroy-method="stop">
<property name="compass"><ref bean="compass" /></property>
<property name="gpsDevices">
<list>
<ref bean="hibernateGpsDevice" />
</list>
</property>
</bean>
<bean id="annotationConfiguration" class="org.compass.annotations.config.CompassAnnotationsConfiguration"></bean>
Если я получаю хиты, то почему в них нет данных