Package com.db4o.internal
Class StoredClassImpl
- java.lang.Object
-
- com.db4o.internal.StoredClassImpl
-
- All Implemented Interfaces:
StoredClass
public class StoredClassImpl extends java.lang.Object implements StoredClass
-
-
Constructor Summary
Constructors Constructor Description StoredClassImpl(Transaction transaction, ClassMetadata classMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
long[]
getIDs()
returns an array of IDs of all stored object instances of this stored class.java.lang.String
getName()
returns the name of this stored class.StoredClass
getParentStoredClass()
returns the StoredClass for the parent of the class, this StoredClass represents.StoredField[]
getStoredFields()
returns all stored fields of this stored class.boolean
hasClassIndex()
returns true if this StoredClass has a class index.int
hashCode()
int
instanceCount()
Returns the number of instances of this class that have been persisted to the database, as seen by the transaction (container) that produces this StoredClass instance.void
rename(java.lang.String newName)
renames this stored class.StoredField
storedField(java.lang.String name, java.lang.Object type)
returns an existing stored field of this stored class.java.lang.String
toString()
-
-
-
Constructor Detail
-
StoredClassImpl
public StoredClassImpl(Transaction transaction, ClassMetadata classMetadata)
-
-
Method Detail
-
getIDs
public long[] getIDs()
Description copied from interface:StoredClass
returns an array of IDs of all stored object instances of this stored class.- Specified by:
getIDs
in interfaceStoredClass
-
getName
public java.lang.String getName()
Description copied from interface:StoredClass
returns the name of this stored class.- Specified by:
getName
in interfaceStoredClass
-
getParentStoredClass
public StoredClass getParentStoredClass()
Description copied from interface:StoredClass
returns the StoredClass for the parent of the class, this StoredClass represents.- Specified by:
getParentStoredClass
in interfaceStoredClass
-
getStoredFields
public StoredField[] getStoredFields()
Description copied from interface:StoredClass
returns all stored fields of this stored class.- Specified by:
getStoredFields
in interfaceStoredClass
-
hasClassIndex
public boolean hasClassIndex()
Description copied from interface:StoredClass
returns true if this StoredClass has a class index.- Specified by:
hasClassIndex
in interfaceStoredClass
-
rename
public void rename(java.lang.String newName)
Description copied from interface:StoredClass
renames this stored class.
After renaming one or multiple classes the ObjectContainer has to be closed and reopened to allow internal caches to be refreshed.
.NET: As the name you should provide [Classname, Assemblyname]- Specified by:
rename
in interfaceStoredClass
- Parameters:
newName
- the new name
-
storedField
public StoredField storedField(java.lang.String name, java.lang.Object type)
Description copied from interface:StoredClass
returns an existing stored field of this stored class.- Specified by:
storedField
in interfaceStoredClass
- Parameters:
name
- the name of the fieldtype
- the type of the field. There are four possibilities how to supply the type:
- a Class object. (.NET: a Type object)
- a fully qualified classname.
- any object to be used as a template.
- null, if the first found field should be returned.- Returns:
- the
StoredField
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
instanceCount
public int instanceCount()
Description copied from interface:StoredClass
Returns the number of instances of this class that have been persisted to the database, as seen by the transaction (container) that produces this StoredClass instance.- Specified by:
instanceCount
in interfaceStoredClass
- Returns:
- The number of instances
-
-