/** * For debugging purposes, prints a summary of the contents and identifier * of this reference set. * * @return human readable string representation of this object. This is not * regarded as 'stable' and should not be parsed for any reason! */ @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getId() + " [" + externalReferences.size() + "]\n"); for (ExternalReferenceSPI ref : externalReferences) { sb.append(" " + ref.toString() + "\n"); } return sb.toString(); }
/** * 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; }
/** * {@inheritDoc} */ public ReferenceSet registerReferenceSet( Set<ExternalReferenceSPI> references) throws ReferenceSetServiceException { checkDao(); checkGenerator(); ReferenceSetImpl rsi = new ReferenceSetImpl(); rsi .setExternalReferences(new HashSet<ExternalReferenceSPI>( references)); T2Reference id = t2ReferenceGenerator.nextReferenceSetReference(); rsi.setTypedId(T2ReferenceImpl.getAsImpl(id)); try { referenceSetDao.store(rsi); return rsi; } catch (DaoException de) { throw new ReferenceSetServiceException(de); } } }
ReferenceSetImpl rsi = new ReferenceSetImpl(new HashSet<ExternalReferenceSPI>( references), T2ReferenceImpl.getAsImpl(id));
/** * {@inheritDoc} */ public ReferenceSet registerReferenceSet( Set<ExternalReferenceSPI> references, ReferenceContext context) throws ReferenceSetServiceException { checkDao(); checkGenerator(); context = EmptyReferenceContext.checkContext(context); ReferenceSetImpl rsi = new ReferenceSetImpl(); rsi .setExternalReferences(new HashSet<ExternalReferenceSPI>( references)); T2Reference id = getGenerator(context).nextReferenceSetReference(); rsi.setTypedId(T2ReferenceImpl.getAsImpl(id)); try { referenceSetDao.store(rsi); return rsi; } catch (DaoException de) { throw new ReferenceSetServiceException(de); } } }
id.setNamespacePart("testNamespace"); id.setLocalPart("testLocal"); ReferenceSetImpl rs = new ReferenceSetImpl( new HashSet<ExternalReferenceSPI>(), id); o.store(rs);
id.setNamespacePart("testNamespace"); id.setLocalPart("testLocal"); ReferenceSetImpl rs = new ReferenceSetImpl( new HashSet<ExternalReferenceSPI>(), id); o.store(rs);
/** * For debugging purposes, prints a summary of the contents and identifier * of this reference set. * * @return human readable string representation of this object. This is not * regarded as 'stable' and should not be parsed for any reason! */ @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getId() + " [" + externalReferences.size() + "]\n"); for (ExternalReferenceSPI ref : externalReferences) { sb.append(" " + ref.toString() + "\n"); } return sb.toString(); }
/** * 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; }
/** * For debugging purposes, prints a summary of the contents and identifier * of this reference set. * * @return human readable string representation of this object. This is not * regarded as 'stable' and should not be parsed for any reason! */ @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(getId() + " [" + externalReferences.size() + "]\n"); for (ExternalReferenceSPI ref : externalReferences) { sb.append(" " + ref.toString() + "\n"); } return sb.toString(); }
/** * 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(); } }