1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| @AnalyzerDefs( { @AnalyzerDef(name = "jobAnalyzer", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = {
@TokenFilterDef(factory = ISOLatin1AccentFilterFactory.class),
@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = { @Parameter(name = "language", value = "French") }) }) })
@FullTextFilterDefs( {
@FullTextFilterDef(name = "JobEntity.filter.geoCode", impl = GeoFilter.class, cache = FilterCacheModeType.NONE),
@FullTextFilterDef(name = "JobEntity.filter.geoZipCode", impl = GeoZipFilter.class, cache = FilterCacheModeType.NONE),
@FullTextFilterDef(name = "JobEntity.filter.toPurge", impl = PurgeFilter.class, cache = FilterCacheModeType.NONE),
@FullTextFilterDef(name = "JobEntity.filter.criteriaCode", impl = CriteriaFilter.class, cache = FilterCacheModeType.NONE),
@FullTextFilterDef(name = "JobEntity.filter.telesiteCriteriaCode", impl = TelesiteCriteriaFilter.class, cache = FilterCacheModeType.NONE) })
@Entity
@Indexed(index = "indexes/job")
@Table(name = "job")
@Analyzer(definition = "jobAnalyzer")
public class JobEntity implements IJob, Serializable {
// ========================================================================
// Instances variables
// ========================================================================
/**
*
*/
private static final long serialVersionUID = -1496587007336871708L;
@Id
@DocumentId
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Fields( { @Field(index = Index.UN_TOKENIZED, name = "sortByName"),
@Field(index = Index.TOKENIZED) })
@Column(length = 250)
@Boost(2)
// @FieldBridge(impl=StringSeparatorBridge.class)
private String name;
@Field(index = Index.TOKENIZED)
@Column(length = 25000)
// @FieldBridge(impl=StringSeparatorBridge.class)
private String description;
// Functions are precreated so CascadeType.PERSIST is rather useless.
// It could have been here for the beauty of the work, but who cares for the
// beauty ...
@ManyToOne(targetEntity = FunctionEntity.class, fetch = FetchType.EAGER)
private IFunction function;
@OneToOne(optional = true, targetEntity = BasicAddressEntity.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private IBasicAddress address;
@OneToOne(optional = true, targetEntity = AddressEntity.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private IAddress workAddress;
@ManyToOne(targetEntity = CompanyEntity.class, fetch = FetchType.EAGER)
private ICompany company;
private String reference;
private long creationDate;
private long modificationDate;
@Field(index = Index.UN_TOKENIZED)
private long publicationDate;
private Double latitude;
private Double longitude;
@Field(index = Index.UN_TOKENIZED, name = "latitude")
@Transient
private String latitudeStr;
@Field(index = Index.UN_TOKENIZED, name = "longitude")
@Transient
private String longitudeStr;
@Field(index = Index.UN_TOKENIZED, name = "functionId")
@Transient
private String functionId;
@Field(index = Index.UN_TOKENIZED, name = "companyName")
// @FieldBridge(impl=StringSeparatorBridge.class)
@Transient
private String companyName;
@OneToMany(targetEntity = AnswerEntity.class, mappedBy = "job", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<IAnswer> answerList;
@Field(index = Index.UN_TOKENIZED)
private long archivingDate;
private String contactMail;
private String phone;
// /
@ManyToOne(targetEntity = TypeEntity.class, fetch = FetchType.EAGER)
private IType type;
@Field(index = Index.UN_TOKENIZED, name = "typeId")
@Transient
private String typeId;
/**
* In order to candidate on an other site. When a jod is added : Email or
* URL not Email and URL
*/
private String url; |
Partager