MediaEntity (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.industry

## Interface MediaEntity

- All Superinterfaces:
    MetadataObject
  All Known Subinterfaces:
    AAFFileDescriptor, AES3PCMDescriptor, AIFCDescriptor, ANCDataDescriptor, ApplicationObject, ApplicationPluginObject, ApplicationReferencedObject, AuxiliaryDescriptor, AVCSubDescriptor, Avid_MC_Mob_Reference, BWFImportDescriptor, CDCIDescriptor, CDCIDescriptor, CodecDefinition, CommentMarker, Component, CompositionPackage, ConstantValue, ContainerDefinition, ContentStorage, Contributor, ControlPoint, DataDefinition, DataEssenceDescriptor, DefinitionObject, DescriptiveClip, DescriptiveFramework, DescriptiveMarker, DescriptiveObject, Dictionary, EdgeCodeSegment, EssenceData, EssenceDescriptor, EssenceGroup, Event, EventTrack, Filler, FilmDescriptor, GPITrigger, HTMLClip, HTMLDescriptor, Identification, ImportDescriptor, InterchangeObject, InterpolationDefinition, KLVData, KLVDataDefinition, Locator, MaterialPackage, MPEGVideoDescriptor, MultipleDescriptor, NestedScope, NetworkLocator, OperationDefinition, OperationGroup, Organisation, Package, Package, PackageMarker, Parameter, ParameterDefinition, Person, PhysicalDescriptor, PictureDescriptor, PictureDescriptor, PluginDefinition, PolyFileDescriptor, Preface, Pulldown, QAAFFileDescriptor, QComponent, QCompositionPackage, QLocator, QMaterialPackage, QOperationGroup, QPreface, QSegment, QSequence, QSourceClip, QTimecode, RecordingDescriptor, RGBADescriptor, RIFFChunk, ScopeReference, Segment, Selector, Sequence, SimpleDescription, SoundDescriptor, SourceClip, SourcePackage, SourceReferenceSegment, StaticTrack, SubDescriptor, TaggedValue, TaggedValue, TaggedValueDefinition, TapeDescriptor, TapeDescriptor, TextClip, TextLocator, TIFFDescriptor, TimecodeSegment, TimecodeStream, TimecodeStream12M, TimelineTrack, Track, Transition, VaryingValue, VBIDataDescriptor, WAVEDescriptor, WAVEPCMDescriptor, WAVEPCMDescriptor
  All Known Implementing Classes:
    AAFFileDescriptorImpl, AES3PCMDescriptorImpl, AIFCDescriptorImpl, ANCDataDescriptorImpl, ApplicationObjectImpl, ApplicationPluginObjectImpl, ApplicationReferencedObjectImpl, AuxiliaryDescriptorImpl, AVCSubDescriptorImpl, Avid_MC_Mob_ReferenceImpl, BWFImportDescriptorImpl, CDCIDescriptorImpl, CodecDefinitionImpl, CommentMarkerImpl, ComponentImpl, CompositionPackageImpl, ConstantValueImpl, ContainerDefinitionImpl, ContentStorageImpl, ContributorImpl, ControlPointImpl, DataDefinitionImpl, DataEssenceDescriptorImpl, DefinitionObjectImpl, DescriptiveClipImpl, DescriptiveFrameworkImpl, DescriptiveMarkerImpl, DescriptiveObjectImpl, DictionaryImpl, EdgeCodeSegmentImpl, EssenceDataImpl, EssenceDescriptorImpl, EssenceGroupImpl, EventImpl, EventTrackImpl, FillerImpl, FilmDescriptorImpl, GPITriggerImpl, HTMLClipImpl, HTMLDescriptorImpl, IdentificationImpl, ImportDescriptorImpl, InterchangeObjectImpl, InterpolationDefinitionImpl, KLVDataDefinitionImpl, KLVDataImpl, LocatorImpl, MaterialPackageImpl, MPEGVideoDescriptorImpl, MultipleDescriptorImpl, NestedScopeImpl, NetworkLocatorImpl, OperationDefinitionImpl, OperationGroupImpl, OrganisationImpl, PackageImpl, PackageMarkerImpl, ParameterDefinitionImpl, ParameterImpl, PersonImpl, PhysicalDescriptorImpl, PictureDescriptorImpl, PluginDefinitionImpl, PolyFileDescriptorImpl, PrefaceImpl, PulldownImpl, RecordingDescriptorImpl, RGBADescriptorImpl, RIFFChunkImpl, ScopeReferenceImpl, SegmentImpl, SelectorImpl, SequenceImpl, SimpleDescriptionImpl, SoundDescriptorImpl, SourceClipImpl, SourcePackageImpl, SourceReferenceSegmentImpl, StaticTrackImpl, SubDescriptorImpl, TaggedValueDefinitionImpl, TaggedValueImpl, TapeDescriptorImpl, TextClipImpl, TextLocatorImpl, TIFFDescriptorImpl, TimecodeSegmentImpl, TimecodeStream12MImpl, TimecodeStreamImpl, TimelineTrackImpl, TrackImpl, TransitionImpl, VaryingValueImpl, VBIDataDescriptorImpl, WAVEDescriptorImpl, WAVEPCMDescriptorImpl, WeakReference

      public interface MediaEntity
      extends MetadataObject

  Specifies a media class with metadata that can be persisted using the Java Persistence API. All media entities must provide a Java long persistent identifier and an index that is used to order values if the entity is persisted as part of a strong reference vector.

  The implementing class or one of its superclasses must provide fields "`persistentID`" and "`persistentIndex`" so that the JPA implementation can create and manipulate objects as appropriate. Here is an example of the required code:

           private Long persistentID = null;
           private int persistentIndex = 0;

           public Long getPersistentID() {

               return persistentID;
           }

           public void setPersistentIndex(
               int index) {

               this.persistentIndex = index;
           }

  Once these fields are provided and the methods are implemented, entities can be managed by an appropriately configured entity manager. The configuration is generated by the `JPAGenerator.generateORM(java.util.Collection, String)` method.

  See Also:
    `TypeDefinitionStrongObjectReference`, `TypeDefinitionVariableArray`, `JPAGenerator.generateORM(java.util.Collection, String)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `MediaEntity` | `clone()` Create a cloned copy of this media entity.
    `Long` | `getPersistentID()` Returns the persistent identifier for this media entity.
    `void` | `setPersistentIndex(int index)` If the media entity is an element of a strong reference vector, set the index of that element in the vector just before the value is persisted.

- - ### Method Detail

    - #### getPersistentID

          Long getPersistentID()

      Returns the persistent identifier for this media entity. This will be automatically generated by the persistence provider when the object is persisted for the first time. Before this, the identifier will be null.

      Returns:
        Persistent identifier for this media entity.

    - #### setPersistentIndex

          void setPersistentIndex(int index)

      If the media entity is an element of a strong reference vector, set the index of that element in the vector just before the value is persisted. When the value is retrieved, the index will be used to restore the item to the correct position in its list. This is required to overcome a shortcoming of the Java Persistence API when persisting ordered collections.

      Parameters:
        `index` - Index of the entity within the list that contains it.

    - #### clone

          MediaEntity clone()

      Create a cloned copy of this media entity. This is required for all targets of a strong reference to ensure that the target of a reference is owned by its source object.

      Returns:
        Cloned copy of this media entity.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.