Package org.intermine.objectstore.query
Class QueryForeignKey
- java.lang.Object
-
- org.intermine.objectstore.query.QueryForeignKey
-
- All Implemented Interfaces:
QueryEvaluable,QueryNode,QueryOrderable,QuerySelectable
public class QueryForeignKey extends java.lang.Object implements QueryEvaluable
Represents the ID of a field of a QueryClass that is a business object- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringfieldNameprotected QueryClassqc
-
Constructor Summary
Constructors Constructor Description QueryForeignKey(QueryClass qc, java.lang.String fieldName)Constructs a QueryForeignKey representing the specified field of a QueryClass
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetApproximateType()Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.java.lang.StringgetFieldName()Gets the fieldname of this QueryReference.QueryClassgetQueryClass()Gets the QueryClass of which this reference is an member.java.lang.Class<?>getType()Gets the Java class of this QueryReference.voidyouAreType(java.lang.Class<?> cls)Allows a caller to suggest to this object that it holds a value of a certain type.
-
-
-
Field Detail
-
qc
protected QueryClass qc
-
fieldName
protected java.lang.String fieldName
-
-
Constructor Detail
-
QueryForeignKey
public QueryForeignKey(QueryClass qc, java.lang.String fieldName)
Constructs a QueryForeignKey representing the specified field of a QueryClass- Parameters:
qc- the QueryClassfieldName- the name of the relevant field- Throws:
java.lang.NullPointerException- if the field name is nulljava.lang.IllegalArgumentException- if the field is not a reference, or does not exist
-
-
Method Detail
-
getQueryClass
public QueryClass getQueryClass()
Gets the QueryClass of which this reference is an member.- Returns:
- the QueryClass
-
getType
public java.lang.Class<?> getType()
Gets the Java class of this QueryReference.- Specified by:
getTypein interfaceQueryOrderable- Specified by:
getTypein interfaceQuerySelectable- Returns:
- the class name
-
getFieldName
public java.lang.String getFieldName()
Gets the fieldname of this QueryReference.- Returns:
- the field name
-
youAreType
public void youAreType(java.lang.Class<?> cls)
Allows a caller to suggest to this object that it holds a value of a certain type. This method should only be called on objects which report their type to be UnknownTypeValue. Otherwise, this method will throw and exception.- Specified by:
youAreTypein interfaceQueryEvaluable- Parameters:
cls- the Class of the type to be imposed on this object
-
getApproximateType
public int getApproximateType()
Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.- Specified by:
getApproximateTypein interfaceQueryEvaluable- Returns:
- an int, as described in UnknownTypeValue
-
-