📄 uiqueryvalue.java
字号:
/*
*
* Copyright (c) 2004 SourceTap - www.sourcetap.com
*
* The contents of this file are subject to the SourceTap Public License
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*/
package com.sourcetap.sfa.ui;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityComparisonOperator;
/**
* This class holds the attributes of one value within a query used in the UI builder.
*
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
* @see #UIQuery
*/
public class UIQueryValue {
public static final String module = UIQueryValue.class.getName();
/*
* Query Value ID - Uniquely identifies this query value
*/
protected String queryValueId = "";
/*
* Query ID - Uniquely identifies the query to which this query value is attached
*/
protected String queryId = "";
/*
* Attribute ID - Uniquely identifies an attribute defined in the UI data
*/
protected String attributeId = "";
/*
* Attribute Value - The value to be compared to the specified attribute on entities in the data base
* when the query is executed
*/
protected String attributeValue = "";
/*
* Entity Operator - The operator to be used to compare the value to the specified attribute on
* entities in the data base when the query is executed
*/
protected EntityComparisonOperator entityOperator = null;
/*
* Dislay Type Id - The type of the field being queried, which is used to determine how to add the condition.
* This allows for SELECT fields to be searched on lookup tables
*/
protected String displayTypeId = "";
/*
* Dislay Object Id - The display object of the field being queried, which is used to determine how to add the condition.
* This allows for SELECT fields to be searched on lookup tables
*/
protected String displayObjectId = "";
/**
* Basic constructor
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public UIQueryValue() {
}
/**
* Constructor with initial values
* @param queryvalueId_ Query Value ID - Uniquely identifies this query value
* @param queryId_ Query ID - Uniquely identifies the query to which this query value is attached
* @param attributeId_ Attribute ID - Uniquely identifies an attribute defined in the UI data
* @param attributeValue_ The value to be compared to the specified attribute on entities in the data base
* when the query is executed
* @param entityOperator_ The operator to be used to compare the value to the specified attribute on
* entities in the data base when the query is executed
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public UIQueryValue(String queryValueId_, String queryId_,
String attributeId_, String attributeValue_,
EntityComparisonOperator entityOperator_,
String displayTypeId_, String displayObjectId_) {
setQueryValueId(queryValueId_);
setAttributeId(attributeId_);
setQueryId(queryId_);
setAttributeValue(attributeValue_);
setEntityOperator(entityOperator_);
setDisplayTypeId(displayTypeId_);
setDisplayObjectId(displayObjectId_);
}
/**
* Gets the Query Value ID
* @return_ Query Value ID - Uniquely identifies this query value
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public String getQueryValueId() {
return (queryValueId == null) ? "" : queryValueId;
}
/**
* Sets the Query Value ID
* @param queryvalueId_ Query Value ID - Uniquely identifies this query value
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setQueryValueId(String queryValueId_) {
queryValueId = queryValueId_;
return;
}
/**
* Gets the Query ID
* @param queryId_ Query ID - Uniquely identifies the query to which this query value is attached
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public String getQueryId() {
return (queryId == null) ? "" : queryId;
}
/**
* Sets the Query ID
* @return Query ID - Uniquely identifies the query to which this query value is attached
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setQueryId(String queryId_) {
queryId = queryId_;
return;
}
/**
* Gets the attribute ID
* @param attributeId_ Attribute ID - Uniquely identifies an attribute defined in the UI data
*/
public String getAttributeId() {
return (attributeId == null) ? "" : attributeId;
}
/**
* Sets the attribute ID
* @return Attribute ID - Uniquely identifies an attribute defined in the UI data
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setAttributeId(String attributeId_) {
attributeId = attributeId_;
return;
}
/**
* Gets the Attribute Value
* return Attribute Value - The value to be compared to the specified attribute on entities in the data base
* when the query is executed
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public String getAttributeValue() {
return (attributeValue == null) ? "" : attributeValue;
}
/**
* Sets the Attribute Value
* @param attributeValue_ Attribute Value - The value to be compared to the specified attribute on entities in the data base
* when the query is executed
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setAttributeValue(String attributeValue_) {
attributeValue = attributeValue_;
return;
}
/**
* Gets the Query Operator
* @return The operator to be used to compare the value to the specified attribute on
* entities in the data base when the query is executed
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public EntityComparisonOperator getEntityOperator() {
return entityOperator;
}
/**
* Sets the Query Operator
* @param entityOperator_ The operator to be used to compare the value to the specified attribute on
* entities in the data base when the query is executed
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setEntityOperator(EntityComparisonOperator entityOperator_) {
entityOperator = entityOperator_;
return;
}
/**
* Gets the Display Type ID
* @return_ Display Type ID - What type is used to display the field
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public String getDisplayTypeId() {
return (displayTypeId == null) ? "" : displayTypeId;
}
/**
* Sets the Display Type ID
* @param displayTypeId_ - the display type for the field
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setDisplayTypeId(String displayTypeId_) {
displayTypeId = displayTypeId_;
return;
}
/**
* Gets the Display Object ID
* @return_ Display Type ID - What object is used to display the field
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public String getDisplayObjectId() {
return (displayObjectId == null) ? "" : displayObjectId;
}
/**
* Sets the Display Object ID
* @param displayObjectId_ - the display object for the field
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public void setDisplayObjectId(String displayObjectId_) {
displayObjectId = displayObjectId_;
return;
}
/**
* Creates a generic value for this query value.
* @param delegator Generic delegator object required to attach to the correct data source
* @return Generic value representing this query value
* @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
*/
public GenericValue toGenericValue(GenericDelegator delegator) {
GenericValue uiQueryValueGV = new GenericValue(delegator.getModelEntity(
"UiQueryValue"));
uiQueryValueGV.setDelegator(delegator);
uiQueryValueGV.set("queryValueId", getQueryValueId());
uiQueryValueGV.set("queryId", getQueryId());
uiQueryValueGV.set("attributeId", getAttributeId());
uiQueryValueGV.set("attributeValue", getAttributeValue());
uiQueryValueGV.set("queryOperatorId",
(getEntityOperator() == null) ? "1"
: String.valueOf(getEntityOperator().getId()));
uiQueryValueGV.set("displayTypeId", getDisplayTypeId());
uiQueryValueGV.set("displayObjectId", getDisplayObjectId());
return uiQueryValueGV;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -