Objectivity for Java Reference

com.objy.db.app
Class ManyToMany

java.lang.Object
  |
  +--com.objy.db.app.Relationship
        |
        +--com.objy.db.app.ManyToMany

public final class ManyToMany
extends Relationship

Defines a many-to-many relationship on a class.

The class on which a many-to-many relationship is being defined must define a public static relationship method that returns a properly initialized instance of this class.

Functionality
Constructors ManyToMany(String, String, String, byte)
ManyToMany(String, String, String, byte, byte, boolean, boolean, byte)
Testing isToMany()
isOtherToMany()


Fields inherited from class com.objy.db.app.Relationship
COPY_COPY, COPY_DELETE, COPY_MOVE, INLINE_LONG, INLINE_NONE, INLINE_SHORT, PRIVATE, PROTECTED, PUBLIC, VERSION_COPY, VERSION_DELETE, VERSION_MOVE
 
Constructor Summary
ManyToMany(String memberName, String otherClassName, String otherMemberName)
          Deprecated. Replaced by ManyToMany(String, String, String, byte).
ManyToMany(String memberName, String otherClassName, String otherMemberName, byte inlineMode)
          Constructs a bidirectional many-to-many relationship with the default version and copy semantics, no delete or lock propagation, and the specified inline mode.
ManyToMany(String memberName, String otherClassName, String otherMemberName, byte copyMode, byte versionMode, boolean deletePropagate, boolean lockPropagate)
          Deprecated. Replaced by ManyToMany(String, String, String, byte, byte, boolean, boolean, byte).
ManyToMany(String memberName, String otherClassName, String otherMemberName, byte copyMode, byte versionMode, boolean deletePropagate, boolean lockPropagate, byte inlineMode)
          Constructs a bidirectional many-to-many relationship with the specified version and copy semantics, delete and lock propagation behavior, and inline mode.
 
Method Summary
 void assertValidMember(String className, Class memberClass, String memberName)
          Reserved for internal use; you should not call this method.
 boolean isOtherToMany()
          Tests whether the inverse of this relationship is a to-many relationship.
 boolean isToMany()
          Tests whether this relationship is a to-many relationship.
 
Methods inherited from class com.objy.db.app.Relationship
assertOtherRelMatches, dumpRelInfo, getAccessControl, getAssocNum, getCopyMode, getDirection, getInlineMode, getMemberID, getMemberName, getOtherClass, getOtherMember, getVersionMode, isBidirectional, isDefined, isDeletePropagated, isInline, isLockPropagated, setAccessControl, setAssocNum, setDefined, setDirection, setMemberID, setMemberIDAndAssocNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManyToMany

public ManyToMany(String memberName,
                  String otherClassName,
                  String otherMemberName,
                  byte copyMode,
                  byte versionMode,
                  boolean deletePropagate,
                  boolean lockPropagate)
Deprecated. Replaced by ManyToMany(String, String, String, byte, byte, boolean, boolean, byte).


ManyToMany

public ManyToMany(String memberName,
                  String otherClassName,
                  String otherMemberName,
                  byte copyMode,
                  byte versionMode,
                  boolean deletePropagate,
                  boolean lockPropagate,
                  byte inlineMode)
Constructs a bidirectional many-to-many relationship with the specified version and copy semantics, delete and lock propagation behavior, and inline mode.

You should use this constructor only in the static method that creates and returns the relationship object corresponding to a relationship field of a persistent object.

Parameters:
memberName - The name of the relationship field.

otherClassName - The package-qualified name of the related class.

otherMemberName - The name of the inverse relationship field in the related class.

copyMode - Specifies what to do with this relationship when an object is copied; one of the following constants defined in the Relationship class:
COPY_DELETE
Delete this relationship in the copy of the object and leave it in the original object.
COPY_MOVE
Move this relationship from the original object to the copy of the object.
COPY_COPY
Copy this relationship from the original object to the copy of the object.

versionMode - Specifies what to do with this relationship when a new version of an object is created; one of the following constants defined in the Relationship class:
VERSION_DELETE
Delete this relationship in the new version of the object and leave it in the original object.
VERSION_MOVE
Move this relationship from the original object to the new version of the object.
VERSION_COPY
Copy this relationship from the original object to the new version of the object.

Note: Currently C++ and Smalltalk applications can create new versions of objects, but Java applications cannot.

deletePropagate - True if delete operations should be propagated; otherwise false.

lockPropagate - True if lock operations should be propagated; otherwise false.

inlineMode - Specifies how to store this relationship; one of the following constants defined in the Relationship class:
INLINE_NONE
The relationship is non-inline.
INLINE_LONG
The relationship is long inline.
INLINE_SHORT
The relationship is short inline.

ManyToMany

public ManyToMany(String memberName,
                  String otherClassName,
                  String otherMemberName)
Deprecated. Replaced by ManyToMany(String, String, String, byte).


ManyToMany

public ManyToMany(String memberName,
                  String otherClassName,
                  String otherMemberName,
                  byte inlineMode)
Constructs a bidirectional many-to-many relationship with the default version and copy semantics, no delete or lock propagation, and the specified inline mode.

When you create a copy or a new version of an object with this relationship, the relationship will be deleted in the new copy or version and kept in the original.

You should use this constructor only in the static method that creates and returns the relationship object corresponding to a relationship field of a persistent object.

Parameters:
memberName - The name of the relationship field.

otherClassName - The package-qualified name of the related class.

otherMemberName - The name of the relationship field in the related class.

inlineMode - Specifies how to store this relationship; one of the following constants defined in the Relationship class:
INLINE_NONE
The relationship is non-inline.
INLINE_LONG
The relationship is long inline.
INLINE_SHORT
The relationship is short inline.
Method Detail

isToMany

public boolean isToMany()
Tests whether this relationship is a to-many relationship.

All many-to-many relationships are to-many relationships, so this method always returns true.

Overrides:
isToMany in class Relationship
Returns:
True.

isOtherToMany

public boolean isOtherToMany()
Tests whether the inverse of this relationship is a to-many relationship.

All many-to-many relationships are bidirectional and the inverse of a many-to-many relationship is always to-many, so this method always returns true.

Overrides:
isOtherToMany in class Relationship
Returns:
True.


assertValidMember

public void assertValidMember(String className,
                              Class memberClass,
                              String memberName)
Reserved for internal use; you should not call this method.

Overrides:
assertValidMember in class Relationship

Objectivity for Java Reference

Copyright © 2000 Objectivity, Inc. All rights reserved.