org.hibernate.ogm.dialect.mongodb
Class MongoDBDialect

java.lang.Object
  extended by org.hibernate.ogm.dialect.mongodb.MongoDBDialect
All Implemented Interfaces:
Serializable, GridDialect, org.hibernate.service.Service

public class MongoDBDialect
extends Object
implements GridDialect

Each Tuple entry is stored as a property in a MongoDB document. Each association is stored in an association document containing three properties: - the association table name (optionally) - the RowKey column names and values - the tuples as an array of elements Associations can be stored as: - one MongoDB collection per association class. The collection name is prefixed. - one MongoDB collection for all associations (the association table name property in then used) - embed the collection info in the owning entity document is planned but not supported at the moment (OGM-177) Collection of embeddable are stored within the owning entity document under the unqualified collection role

Author:
Guillaume Scheibel , Alan Fitton , Emmanuel Bernard
See Also:
Serialized Form

Field Summary
static String ASSOCIATIONS_COLLECTION_PREFIX
           
static String ID_FIELDNAME
           
static String PROPERTY_SEPARATOR
           
static String ROWS_FIELDNAME
           
static String SEQUENCE_VALUE
           
static String TABLE_FIELDNAME
           
 
Constructor Summary
MongoDBDialect(MongoDBDatastoreProvider provider)
           
 
Method Summary
 Association createAssociation(AssociationKey key)
           
 Tuple createTuple(EntityKey key)
           
 Tuple createTupleAssociation(AssociationKey associationKey, RowKey rowKey)
           
 Association getAssociation(AssociationKey key, AssociationContext associationContext)
           
 org.hibernate.dialect.lock.LockingStrategy getLockingStrategy(org.hibernate.persister.entity.Lockable lockable, org.hibernate.LockMode lockMode)
           
 Tuple getTuple(EntityKey key, TupleContext tupleContext)
           
 void nextValue(RowKey key, org.hibernate.id.IntegralDataTypeHolder value, int increment, int initialValue)
           
 GridType overrideType(org.hibernate.type.Type type)
           
 void removeAssociation(AssociationKey key)
           
 void removeTuple(EntityKey key)
           
 void updateAssociation(Association association, AssociationKey key)
           
 void updateTuple(Tuple tuple, EntityKey key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_FIELDNAME

public static final String ID_FIELDNAME
See Also:
Constant Field Values

PROPERTY_SEPARATOR

public static final String PROPERTY_SEPARATOR
See Also:
Constant Field Values

SEQUENCE_VALUE

public static final String SEQUENCE_VALUE
See Also:
Constant Field Values

ROWS_FIELDNAME

public static final String ROWS_FIELDNAME
See Also:
Constant Field Values

TABLE_FIELDNAME

public static final String TABLE_FIELDNAME
See Also:
Constant Field Values

ASSOCIATIONS_COLLECTION_PREFIX

public static final String ASSOCIATIONS_COLLECTION_PREFIX
See Also:
Constant Field Values
Constructor Detail

MongoDBDialect

public MongoDBDialect(MongoDBDatastoreProvider provider)
Method Detail

getLockingStrategy

public org.hibernate.dialect.lock.LockingStrategy getLockingStrategy(org.hibernate.persister.entity.Lockable lockable,
                                                                     org.hibernate.LockMode lockMode)
Specified by:
getLockingStrategy in interface GridDialect

getTuple

public Tuple getTuple(EntityKey key,
                      TupleContext tupleContext)
Specified by:
getTuple in interface GridDialect

createTuple

public Tuple createTuple(EntityKey key)
Specified by:
createTuple in interface GridDialect

updateTuple

public void updateTuple(Tuple tuple,
                        EntityKey key)
Specified by:
updateTuple in interface GridDialect

removeTuple

public void removeTuple(EntityKey key)
Specified by:
removeTuple in interface GridDialect

getAssociation

public Association getAssociation(AssociationKey key,
                                  AssociationContext associationContext)
Specified by:
getAssociation in interface GridDialect

createAssociation

public Association createAssociation(AssociationKey key)
Specified by:
createAssociation in interface GridDialect

updateAssociation

public void updateAssociation(Association association,
                              AssociationKey key)
Specified by:
updateAssociation in interface GridDialect

removeAssociation

public void removeAssociation(AssociationKey key)
Specified by:
removeAssociation in interface GridDialect

createTupleAssociation

public Tuple createTupleAssociation(AssociationKey associationKey,
                                    RowKey rowKey)
Specified by:
createTupleAssociation in interface GridDialect

nextValue

public void nextValue(RowKey key,
                      org.hibernate.id.IntegralDataTypeHolder value,
                      int increment,
                      int initialValue)
Specified by:
nextValue in interface GridDialect

overrideType

public GridType overrideType(org.hibernate.type.Type type)
Specified by:
overrideType in interface GridDialect


Copyright © 2010-2012 Hibernate. All Rights Reserved.