Project

General

Profile

Revision 59e36d30

ID59e36d30453a6e3858d143f592ede830c83071e4
Parent e73de755
Child 21d4b866

Added by Andreas Müller over 2 years ago

ref #6581 preliminary revert some changes for making nomenclaturalReference an OriginalSource

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonName.java
237 237
//    @NullOrNotEmpty
238 238
    @Column(length=255)
239 239
    private String appendedPhrase;
240
//
241
//    @XmlElement(name = "NomenclaturalMicroReference")
242
//    @Field
243
//    @CacheUpdate(noUpdate ="titleCache")
244
//    //TODO Val #3379
245
////    @NullOrNotEmpty
246
//    @Column(length=255)
247
//    private String nomenclaturalMicroReference;
240

  
241
    //#6581
242
    @XmlElement(name = "NomenclaturalMicroReference")
243
    @Field
244
    @CacheUpdate(noUpdate ="titleCache")
245
    //TODO Val #3379
246
    //@NullOrNotEmpty
247
    @Column(length=255)
248
    private String nomenclaturalMicroReference;
248 249

  
249 250
    @XmlAttribute
250 251
    @CacheUpdate(noUpdate ={"titleCache","fullTitleCache"})
......
329 330
//    @NotNull
330 331
    @IndexedEmbedded(depth=1)
331 332
    private Rank rank;
332
//
333
//    @XmlElement(name = "NomenclaturalReference")
334
//    @XmlIDREF
335
//    @XmlSchemaType(name = "IDREF")
336
//    @ManyToOne(fetch = FetchType.LAZY)
337
//    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
338
//    @CacheUpdate(noUpdate ="titleCache")
339
//    @IndexedEmbedded
340
//    private Reference nomenclaturalReference;
341 333

  
334
    //#6581
335
    @XmlElement(name = "NomenclaturalReference")
336
    @XmlIDREF
337
    @XmlSchemaType(name = "IDREF")
338
    @ManyToOne(fetch = FetchType.LAZY)
339
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
340
    @CacheUpdate(noUpdate ="titleCache")
341
    @IndexedEmbedded
342
    private Reference nomenclaturalReference;
343

  
344
    //#6581
342 345
    @XmlElement(name = "NomenclaturalSource")
343 346
    @XmlIDREF
344 347
    @XmlSchemaType(name = "IDREF")
......
2273 2276

  
2274 2277
    @Override
2275 2278
    public Reference getNomenclaturalReference(){
2276
        if (this.nomenclaturalSource == null){
2277
            return null;
2278
        }
2279
        return this.nomenclaturalSource.getCitation();
2279
        //#6581
2280
        return this.nomenclaturalReference;
2281
//        if (this.nomenclaturalSource == null){
2282
//            return null;
2283
//        }
2284
//        return this.nomenclaturalSource.getCitation();
2280 2285
    }
2281 2286

  
2282 2287
    @Override
......
2307 2312

  
2308 2313
    @Override
2309 2314
    public void setNomenclaturalReference(Reference nomenclaturalReference){
2310
        getNomenclaturalSource(true).setCitation(nomenclaturalReference);
2311
        checkNullSource();
2315
        //#6581
2316
        this.nomenclaturalReference = nomenclaturalReference;
2317
//        getNomenclaturalSource(true).setCitation(nomenclaturalReference);
2318
//        checkNullSource();
2312 2319
    }
2313 2320
    @Override
2314 2321
    public void setNomenclaturalReference(INomenclaturalReference nomenclaturalReference){
2315 2322
        setNomenclaturalReference(CdmBase.deproxy(nomenclaturalReference, Reference.class));
2316 2323
    }
2317 2324

  
2318

  
2319

  
2320
    /**
2321
     *
2322
     */
2325
    //#6581
2323 2326
    private void checkNullSource() {
2324 2327
        if (this.nomenclaturalSource == null){
2325 2328
            return;
......
2372 2375
    //Details of the nomenclatural reference (protologue).
2373 2376
    @Override
2374 2377
    public String getNomenclaturalMicroReference(){
2375
        if (this.nomenclaturalSource == null){
2376
            return null;
2377
        }
2378
        return this.nomenclaturalSource.getCitationMicroReference();
2378
        //#6581
2379
        return this.nomenclaturalMicroReference;
2380
//        if (this.nomenclaturalSource == null){
2381
//            return null;
2382
//        }
2383
//        return this.nomenclaturalSource.getCitationMicroReference();
2379 2384
    }
2380 2385
    /**
2381 2386
     * @see  #getNomenclaturalMicroReference()
2382 2387
     */
2383 2388
    @Override
2384 2389
    public void setNomenclaturalMicroReference(String nomenclaturalMicroReference){
2385
        this.getNomenclaturalSource(true).setCitationMicroReference(StringUtils.isBlank(nomenclaturalMicroReference)? null : nomenclaturalMicroReference);
2386
        checkNullSource();
2390
        //#6581
2391
        this.nomenclaturalMicroReference = nomenclaturalMicroReference;
2392
//        this.getNomenclaturalSource(true).setCitationMicroReference(StringUtils.isBlank(nomenclaturalMicroReference)? null : nomenclaturalMicroReference);
2393
//        checkNullSource();
2387 2394
    }
2388 2395

  
2389 2396
    @Override

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)