public class PropertyQualification extends SearchQualification
A PropertyQualification consists of a search Class, a property name, a search Value and a comparison operator. The comparison value must be specified as a AttributeValue. For late Binding, the setlateBound function must be called, with dataType of the property specified. This is required there are no rules for mapping property names to dataTypes. Each object is free to use a property name as it chooses.
Roughly, a PropertyQualification translates to the SQL condition
exists (select list of proeprties where name = ' Specified Name' and type = 'Specified Type'
and value 'oper' 'Specified Comparison Value'
// // Usage Examples // Search for documents that are having a property value of RED // in a property called "color" PropertyQualification pq = new PropertyQualification(); pq.setClassname(Document.CLASS_NAME); pq.setPropertyName("color"); // Note that the operators used here are same as that in AttributeQualification. pq.setOperatorType(AttributeQualification.EQUAL); pq.setValue(AttributeValue.newAttributeValue("RED")); pq.setCaseIgnored(ignoreCase); // Using a date type attribute value // This looks for a particular date in a property containing Dates. PropertyQualification pq = new PropertyQualification(); pq.setClassname(Document.CLASS_NAME); pq.setPropertyName("expire-date"); pq.setOperatorType(AttributeQualification.EQUAL); pq.setValue(AttributeValue.newAttributeValue(new GregorianCalendar(1995, 0, 15).getTime())); pq.setDateComparisonLevel(AttributeQualification.DATE_COMP_MONTH); // Using DOCUMENT(or any object type) type attribute value // This looks for a particular document in a property containing DOCUMENT objects PropertyQualification pq = new PropertyQualification(); pq.setClassname(Document.CLASS_NAME); pq.setPropertyName("related-docs"); pq.setOperatorType(AttributeQualification.EQUAL); pq.setValue(AttributeValue.newAttributeValue(new Document[] {d})); // Using late bound attribute value with a property search AttributeValue srchDate = AttributeValue.newAttributeValue(new GregorianCalendar(1995, 0, 1).getTime()); PropertyQualification pq = new PropertyQualification(); pq.setClassname(Document.CLASS_NAME); pq.setPropertyName("expire-date"); pq.setOperatorType(AttributeQualification.EQUAL); pq.setLateBoundDataType(srchDate.getDataType());
Modifier and Type | Field and Description |
---|---|
protected String |
m_Class
The Search Class. defaults to the first Result Class of the SearchSpecification.
|
protected int |
m_CompOper
The comparison operator.
|
protected int |
m_DataType
The dataType of the Attribute.
|
protected int |
m_DateCompLevel
The Date Comparison Level.
|
protected Date |
m_DateValue
The comparison value as a Date.
|
protected boolean |
m_IgnoreCase
IgnoreCase flag.
|
protected boolean |
m_IsLateBound
Is the Qualification dynamically bound?
|
protected String |
m_PropertyName
The property on which the condition is to be applied.
|
protected AttributeValue |
m_Value
The comparison value.
|
static String |
PROPERTY_CLASS
The name of the Property Class.
|
static String |
PROPERTY_COLUMN_IN_LIBRARYOBJECT_CLASS
The name of the joinig attribute on the LibraryObject Class Table
|
static String |
PROPERTY_COLUMN_IN_PROPERTY_CLASS
The name of the joining attribute on the Property Class Table
|
LATE_BIND_OPER
Constructor and Description |
---|
PropertyQualification()
Constructs a PropertyQualification.
|
Modifier and Type | Method and Description |
---|---|
protected void |
accept(oracle.ifs.search.SearchQualificationVisitor v)
Accepts a SearchQualificationVisitor.
|
String |
getClassname()
Returns the search class for this qualification object.
|
int |
getDateComparisonLevel()
Returns the date comparison level.
|
int |
getLateBoundDataType()
Get the data type if the qualification is late bound.
|
int |
getOperatorType()
Gets the operator for this qualification.
|
String |
getPropertyName()
Return the name of the property being searched.
|
AttributeValue |
getValue()
Return the comparison value.
|
boolean |
isCaseIgnored()
Returns true if this object is set to be case insensitive.
|
boolean |
isLateBound()
Returns true if the qualification is late bound.
|
static S_Attribute |
propertyAttribute(S_LibrarySession sess,
int attributeDataType)
Used to get the Attribute on the Property Class for the specified dataType.
|
void |
setCaseIgnored(boolean value)
Sets up case sensitive behavior for this object.
|
void |
setClassname(String clss)
Set the Search Classname.
|
void |
setDateComparisonLevel(int df)
Sets the date comparison value.
|
void |
setLateBoundDataType(int dataType)
Set Qualification as Late Bound.
|
void |
setOperatorType(int oper)
Sets the comparision operator.
|
void |
setOperatorType(String oper)
Sets the comparison operator.
|
void |
setPropertyName(String name)
Set the name of property used in the condition.
|
void |
setValue(AttributeValue av)
Sets the comparison value.
|
protected void |
validateDataType(int dataType)
Checks if dataType is a valid iFS type.
|
clone
public static final String PROPERTY_CLASS
public static final String PROPERTY_COLUMN_IN_PROPERTY_CLASS
public static final String PROPERTY_COLUMN_IN_LIBRARYOBJECT_CLASS
protected String m_Class
SearchClassSpecification
protected String m_PropertyName
protected AttributeValue m_Value
protected Date m_DateValue
protected int m_DataType
Attribute
protected boolean m_IsLateBound
protected int m_CompOper
AttributeQualification
protected int m_DateCompLevel
AttributeQualification
protected boolean m_IgnoreCase
AttributeQualification
public PropertyQualification() throws IfsException
IfsException
public static final S_Attribute propertyAttribute(S_LibrarySession sess, int attributeDataType) throws IfsException
sess
- The LibrarySession to use for retriving Property Class informationattributeDataType
- the type of Attribute. Must be a valid iFS type.IfsException
- 10400 if type is not valid.
or IfsException if retrival of Property Class information from sess fails.public void setClassname(String clss) throws IfsException
Class should be a valid iFS PublicObject or SubClass or an Alias. A null class is taken to mean, use the first Result Class of the SearchSpecification.
clss
- Search Class.IfsException
- if the operation failsSearchClassSpecification
public String getClassname() throws IfsException
IfsException
- if the operation failspublic void setPropertyName(String name) throws IfsException
name
- name of searched property.IfsException
public String getPropertyName()
public void setValue(AttributeValue av) throws IfsException
av
- the comparison value specified as an AttrbuteValueIfsException
- 22002 if av is null.public AttributeValue getValue()
public void setLateBoundDataType(int dataType) throws IfsException
dataType
- property's dataTypeIfsException
- if the operation failspublic int getLateBoundDataType() throws IfsException
IfsException
- if the operation failspublic boolean isLateBound()
isLateBound
in class SearchQualification
public void setOperatorType(String oper) throws IfsException
oper
- comparison operator string; this should be
one of =, <, <=, >, >=, !=, <>, IS NULL,
IS NOT NULL, LIKE or NOT LIKE.IfsException
- if specified operator is not supported.AttributeQualification
public void setOperatorType(int oper) throws IfsException
oper
- comaprison operator must be one of,
AttributeQualification.EQUAL
,
AttributeQualification.GREATER_THAN
,
AttributeQualification.GREATER_THAN_EQUAL
,
AttributeQualification.IS_NOT_NULL
,
AttributeQualification.IS_NULL
,
AttributeQualification.LESS_THAN
,
AttributeQualification.LESS_THAN_EQUAL
,
AttributeQualification.LIKE
IfsException
- if specified operator is not supported.AttributeQualification
public int getOperatorType() throws IfsException
IfsException
public void setDateComparisonLevel(int df) throws IfsException
df
- date comparison level. should be one of
AttributeQualification.DATE_COMP_DAY,
AttributeQualification.DATE_COMP_MONTH,
AttributeQualification.DATE_COMP_YEAR,
AttributeQualification.DATE_COMP_SEC,
AttributeQualification.DATE_COMP_MIN,
AttributeQualification.DATE_COMP_HOURIfsException
- if the operation failsAttributeQualification
public void setCaseIgnored(boolean value) throws IfsException
value
- If true, the searches will be case insensitive.IfsException
- if the operation failspublic int getDateComparisonLevel()
public boolean isCaseIgnored()
protected void accept(oracle.ifs.search.SearchQualificationVisitor v) throws IfsException
accept
in class SearchQualification
v
- SearchQualificationVisitorIfsException
- thrown if Visitor code throws.protected void validateDataType(int dataType) throws IfsException
dataType
- int value representing a dataType.IfsException
- 22113 if dataType is invalid.Copyright © 2023. All rights reserved.