/** * Construct a new ReferenceSetImpl with the given set of external * references and identifier. * * @param references * the set of ExternalReferenceSPI which this reference set * should contain initially * @param id * the T2Reference to use, must be an instance of * ReferenceSetT2ReferenceImpl so hibernate can make use of it as * a compound primary key component */ public ReferenceSetImpl(Set<ExternalReferenceSPI> references, T2ReferenceImpl id) { setTypedId(id); this.externalReferences = references; // Should be at least one - otherwise we cannot calculate the data size if (externalReferences != null && externalReferences.size() > 0){ // Just take the first ExternalReferenceSPI returned ExternalReferenceSPI externalReferenceSPI = externalReferences.toArray(new ExternalReferenceSPI[0])[0]; approximateSizeInBytes = externalReferenceSPI.getApproximateSizeInBytes(); } }