在类 ArchmisImpl.java中引用了类Library.






















































































































































































在配置文件中,有两种配置方式如下.
1.<reference name="library" ref-alias="${library.library}"/>:是引用方式,
在compass reference中有如下解释:
A searchable reference mapping maps between one root searchable class and the other. The mapping is only used for keeping the relationship "alive" when performing un-marshalling. The marshalling process marshals only the referenced object ids (based on its id mappings) and use it later in the un-marshalling process to load the referenced object from the index.
就是说:reference引用的类必须是可检索的根类.如此设置被引用类的root必须设置为true,
2. <component name="library" ref-alias="${library.library}"/>
A searchable component mapping embeds a searchable class within its owning searchable class. The mapping is used to allow for searches that "hit" the component referenced searchable class to return the owning searchable class (or its parent if it also acts a component mapping up until the root object that was saved).
The component referenced searchable class can be either root or not. An example for a non root component can
be a Person class (which is root) with a component mapping to a non root searchable class Name (with
firstName and lastName fields). An example for a root component can be a Customer root searchable class and
an Account searchable class, where when searching for account details, both Account and Customer should
return as hits.





























































































































































