Package com.db4o.ext

Class Db4oDatabase

  • All Implemented Interfaces:
    Internal4, Db4oType

    public class Db4oDatabase
    extends java.lang.Object
    implements Db4oType, Internal4
    Class to identify a database by it's signature.

    db4o UUID handling uses a reference to the Db4oDatabase object, that represents the database an object was created on.
    • Field Detail

      • STATIC_IDENTITY

        public static final Db4oDatabase STATIC_IDENTITY
      • i_signature

        public byte[] i_signature
        Field is public for implementation reasons, DO NOT TOUCH!
      • i_uuid

        public long i_uuid
        Field is public for implementation reasons, DO NOT TOUCH! This field is badly named, it really is the creation time.
    • Constructor Detail

      • Db4oDatabase

        public Db4oDatabase()
        constructor for persistence
      • Db4oDatabase

        public Db4oDatabase​(byte[] signature,
                            long creationTime)
        constructor for comparison and to store new ones
    • Method Detail

      • generate

        public static Db4oDatabase generate()
        generates a new Db4oDatabase object with a unique signature.
      • equals

        public boolean equals​(java.lang.Object obj)
        comparison by signature.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getID

        public int getID​(Transaction trans)
        gets the db4o ID, and may cache it for performance reasons.
        Returns:
        the db4o ID for the ObjectContainer
      • getCreationTime

        public long getCreationTime()
      • getSignature

        public byte[] getSignature()
        returns the unique signature
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isOlderThan

        public boolean isOlderThan​(Db4oDatabase peer)
      • bind

        public int bind​(Transaction trans)
        make sure this Db4oDatabase is stored. Return the ID.