Holger's Java API

## com.antelmann.db
Interface DBReference

All Superinterfaces:
  Serializable

All Known Implementing Classes:
  DBDocument.Header, DefaultDBReference, EntryHeader, GPerson.Header, ImageURLEntry.Thumbnail, Stub

    public interface DBReference

extends Serializable

DBReference represents an Object that can hold a reference to a DBEntry object, providing sufficient means to retrieve that object from a Database. Note that a DBReference may be 'empty', i.e. both, reference class and reference id are null.

Author:
  Holger Antelmann
See Also:
  `Database`, `DBEntry`, `DBEntrySelection`

Field Summary
`static DataFlavor` `REFERENCE_FLAVOR` allows to transfer a `DBReference` instance
`static DataFlavor` `REFERENCE_LIST_FLAVOR` allows to transfer an array of `DBReference` objects

Method Summary
`Class<? extends DBEntry>` `getReferenceClass()` indicates the type of DBEntry that represents the class of the reference ID, so that the instance could be looked up in a Database; this may be null only if the reference itself is null, too.
`Object` `getReferenceID()` returns the ID of the DBEntry this instance refers to; this may be null only if the reference type returns null, too.
`String` `getReferenceString()` provides a meaningful (displayable) description for the referenceID/referenceType or null if there is no reference for this entry.

Field Detail

### REFERENCE_FLAVOR

    static final DataFlavor REFERENCE_FLAVOR

  allows to transfer a `DBReference` instance

### REFERENCE_LIST_FLAVOR

    static final DataFlavor REFERENCE_LIST_FLAVOR

  allows to transfer an array of `DBReference` objects

Method Detail

### getReferenceID

    Object getReferenceID()

  returns the ID of the DBEntry this instance refers to; this may be null only if the reference type returns null, too.

  See Also:
    `DBEntry.getID()`, `DefaultDBReference.isConsistent(DBReference)`

### getReferenceClass

    Class<? extends DBEntry> getReferenceClass()

  indicates the type of DBEntry that represents the class of the reference ID, so that the instance could be looked up in a Database; this may be null only if the reference itself is null, too.

  See Also:
    `Database`, `DBEntry#getClass()`, `DefaultDBReference.isConsistent(DBReference)`

### getReferenceString

    String getReferenceString()

  provides a meaningful (displayable) description for the referenceID/referenceType or null if there is no reference for this entry. Normally, this method would provide some cached info about the reference w/o having to dereference the link through the database. Note that this method may return null even if the reference itself is not null.

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads