Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.kuali.rice.kew.doctype;
Data bean representing an attribute associated at the document type level. e.g. NoteAttribute, EmailAttribute, SearchableAttribute, etc.

Kuali Rice Team (
 //@Sequence(name="KREW_DOC_TYP_ATTR_S", property="id")
 	private static final long serialVersionUID = -4429421648373903566L;
 	private String id;
     @Column(name="RULE_ATTR_ID",insertable=false, updatable=false)
     @Column(name="DOC_TYP_ID",insertable=false, updatable=false)
 	private String documentTypeId;
 	private int orderIndex;
     private Integer lockVerNbr;
 	public void beforeInsert(){
 		OrmUtils.populateAutoIncValue(this, KEWServiceLocator.getEntityManagerFactory().createEntityManager());

id The id to set.
 	public void setId(String id) {
 		this. = id;

Returns the id.
 	public String getId() {
 		return ;

documentTypeId The documentTypeId to set.
 	public void setDocumentTypeId(String documentTypeId) {
		this. = documentTypeId;

Returns the documentTypeId.

ruleAttributeId The ruleAttributeId to set.
	public void setRuleAttributeId(String ruleAttributeId) {
		this. = ruleAttributeId;
        if (ruleAttributeId == null) {
        	 = null;
        } else {
             = RuleAttribute.from(KewApiServiceLocator.getExtensionRepositoryService().getExtensionById(ruleAttributeId));
            //ruleAttribute = getRuleAttributeService().findByRuleAttributeId(ruleAttributeId);

Returns the ruleAttributeId.

ruleAttribute The ruleAttribute to set.
	public void setRuleAttribute(RuleAttribute ruleAttribute) {
		this. = ruleAttribute;

Returns the ruleAttribute.
	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	public int compareTo(Object o) {
        if (o instanceof DocumentTypeAttributeBo) {
            return this.getRuleAttribute().getName().compareTo(((DocumentTypeAttributeBoo).getRuleAttribute().getName());
        return 0;
		return ;
	public void setDocumentType(DocumentType documentType) {
		this. = documentType;
    public int getOrderIndex() {
        return ;
    public void setOrderIndex(int orderIndex) {
        this. = orderIndex;
	public Integer getLockVerNbr() {
		return ;
	public void setLockVerNbr(Integer lockVerNbr) {
		this. = lockVerNbr;
    public static DocumentTypeAttribute to(DocumentTypeAttributeBo documentTypeAttributeBo) {
        if (documentTypeAttributeBo == null) {
            return null;
        DocumentTypeAttribute.Builder builder = DocumentTypeAttribute.Builder.create(documentTypeAttributeBo);
    public static DocumentTypeAttributeBo from(DocumentTypeAttribute dta) {
        // DocumentType BO and DTO are not symmetric
        // set what fields we can
        DocumentTypeAttributeBo bo = new DocumentTypeAttributeBo();
        if (dta.getRuleAttribute() != null) {
        return bo;
New to GrepCode? Check out our FAQ X