Package org.jboss.ejb.client
Class EntityEJBLocator<T extends jakarta.ejb.EJBObject>
- java.lang.Object
-
- org.jboss.ejb.client.EJBLocator<T>
-
- org.jboss.ejb.client.EntityEJBLocator<T>
-
- Type Parameters:
T- the remote view type
- All Implemented Interfaces:
Serializable
public final class EntityEJBLocator<T extends jakarta.ejb.EJBObject> extends EJBLocator<T>
A locator for an entity Enterprise Bean.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, Object primaryKey)Construct a new instance.EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, Object primaryKey, Affinity affinity)Construct a new instance.EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, Object primaryKey)Construct a new instance.EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, Object primaryKey, Affinity affinity)Construct a new instance.EntityEJBLocator(Class<T> viewType, EJBIdentifier identifier, Object primaryKey)Construct a new instance.EntityEJBLocator(Class<T> viewType, EJBIdentifier identifier, Object primaryKey, Affinity affinity)Construct a new instance.EntityEJBLocator(EntityEJBLocator<T> original, Affinity newAffinity)Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends jakarta.ejb.EJBObject>
EntityEJBLocator<T>create(Class<T> viewType, EJBIdentifier identifier, Object primaryKey, Affinity affinity)Construct a new instance.booleanequals(Object other)Determine whether this object is equal to another.booleanequals(EJBLocator<?> other)Determine whether this object is equal to another.booleanequals(EntityEJBLocator<?> other)Determine whether this object is equal to another.ObjectgetPrimaryKey()Get the primary key for the referenced entity.booleanisEntity()Determine if this is an entity locator.<S extends jakarta.ejb.EJBObject>
EntityEJBLocator<? extends S>narrowAsEntity(Class<S> type)Narrow this locator to the target type as a entity locator.<S> EntityEJBLocator<? extends S>narrowTo(Class<S> type)Narrow this locator to the target type.StringtoString()EntityEJBLocator<T>withNewAffinity(Affinity affinity)Create a copy of this locator, but with the new given affinity.-
Methods inherited from class org.jboss.ejb.client.EJBLocator
asStateful, asStateless, canNarrowTo, createProxyInstance, getAffinity, getAppName, getBeanName, getDistinctName, getIdentifier, getModuleName, getProxyClass, getProxyConstructor, getViewType, hashCode, isHome, isStateful, isStateless, narrowAsHome, narrowAsStateful, narrowAsStateless, withSession, withSessionAndAffinity
-
-
-
-
Constructor Detail
-
EntityEJBLocator
public EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, Object primaryKey)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean nameprimaryKey- the entity primary key
-
EntityEJBLocator
public EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, Object primaryKey, Affinity affinity)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean nameprimaryKey- the entity primary keyaffinity- the affinity
-
EntityEJBLocator
public EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, Object primaryKey)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean namedistinctName- the distinct nameprimaryKey- the entity primary key
-
EntityEJBLocator
public EntityEJBLocator(Class<T> viewType, String appName, String moduleName, String beanName, String distinctName, Object primaryKey, Affinity affinity)
Construct a new instance.- Parameters:
viewType- the view typeappName- the application namemoduleName- the module namebeanName- the bean namedistinctName- the distinct nameprimaryKey- the entity primary keyaffinity- the affinity
-
EntityEJBLocator
public EntityEJBLocator(Class<T> viewType, EJBIdentifier identifier, Object primaryKey, Affinity affinity)
Construct a new instance.- Parameters:
viewType- the view typeidentifier- the Enterprise Beans identifierprimaryKey- the entity primary keyaffinity- the affinity
-
EntityEJBLocator
public EntityEJBLocator(Class<T> viewType, EJBIdentifier identifier, Object primaryKey)
Construct a new instance.- Parameters:
viewType- the view typeidentifier- the Enterprise Beans identifierprimaryKey- the entity primary key
-
EntityEJBLocator
public EntityEJBLocator(EntityEJBLocator<T> original, Affinity newAffinity)
Construct a new instance. This constructor creates a copy of the original locator, but with a new affinity.- Parameters:
original- the original locatornewAffinity- the new affinity
-
-
Method Detail
-
create
public static <T extends jakarta.ejb.EJBObject> EntityEJBLocator<T> create(Class<T> viewType, EJBIdentifier identifier, Object primaryKey, Affinity affinity)
Construct a new instance.- Type Parameters:
T- the remote view type- Parameters:
viewType- the view type (must not benull)identifier- the Enterprise Beans identifier (must not benull)primaryKey- the entity primary key (must not benull)affinity- the affinity- Returns:
- the new instance (not
null)
-
withNewAffinity
public EntityEJBLocator<T> withNewAffinity(Affinity affinity)
Description copied from class:EJBLocatorCreate a copy of this locator, but with the new given affinity.- Specified by:
withNewAffinityin classEJBLocator<T extends jakarta.ejb.EJBObject>- Parameters:
affinity- the new affinity- Returns:
- the new locator
-
narrowTo
public <S> EntityEJBLocator<? extends S> narrowTo(Class<S> type)
Description copied from class:EJBLocatorNarrow this locator to the target type.- Overrides:
narrowToin classEJBLocator<T extends jakarta.ejb.EJBObject>- Type Parameters:
S- the target type- Parameters:
type- the target type class- Returns:
- this instance, narrowed to the given type
-
narrowAsEntity
public <S extends jakarta.ejb.EJBObject> EntityEJBLocator<? extends S> narrowAsEntity(Class<S> type)
Description copied from class:EJBLocatorNarrow this locator to the target type as a entity locator.- Overrides:
narrowAsEntityin classEJBLocator<T extends jakarta.ejb.EJBObject>- Type Parameters:
S- the target type- Parameters:
type- the target type class- Returns:
- this instance, narrowed to the given type and cast as a entity locator
-
isEntity
public boolean isEntity()
Description copied from class:EJBLocatorDetermine if this is an entity locator. If so, calls toEJBLocator.narrowAsEntity(Class)will generally succeed.- Overrides:
isEntityin classEJBLocator<T extends jakarta.ejb.EJBObject>- Returns:
trueif this locator is an entity,falseotherwise
-
getPrimaryKey
public Object getPrimaryKey()
Get the primary key for the referenced entity.- Returns:
- the primary key for the referenced entity
-
equals
public boolean equals(Object other)
Determine whether this object is equal to another.- Overrides:
equalsin classEJBLocator<T extends jakarta.ejb.EJBObject>- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
public boolean equals(EJBLocator<?> other)
Determine whether this object is equal to another.- Overrides:
equalsin classEJBLocator<T extends jakarta.ejb.EJBObject>- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
equals
public boolean equals(EntityEJBLocator<?> other)
Determine whether this object is equal to another.- Parameters:
other- the other object- Returns:
trueif they are equal,falseotherwise
-
toString
public String toString()
- Overrides:
toStringin classEJBLocator<T extends jakarta.ejb.EJBObject>
-
-