Package org.nxplanner.domain

Examples of org.nxplanner.domain.Attribute


public class AttributeRepositoryImpl implements AttributeRepository {
    public void setAttribute(int targetId, String name, String value) throws RepositoryException {
        try {
            final Session session = ThreadSession.get();
            final Attribute attribute = new Attribute(targetId, name, value);
            List existingAttributes = session.find("from a in "+Attribute.class+
                    " where targetId = ? and name= ?",
                    new Object[]{ new Integer(targetId), name },
                    new Type[]{ Hibernate.INTEGER, Hibernate.STRING });
            if (existingAttributes.size() == 0) {
View Full Code Here


    }

    public String getAttribute(int targetId, String name) throws RepositoryException {
        try {
            final Session session = ThreadSession.get();
            final Attribute id = new Attribute(targetId, name, null);
            Attribute attribute = (Attribute)session.load(Attribute.class, id);
            return attribute.getValue();
        } catch (net.sf.hibernate.ObjectNotFoundException e) {
            return null;
        } catch (RuntimeException e) {
            throw e;
        } catch (HibernateException e) {
View Full Code Here

            List attributeObjects = session.find("from a in "+Attribute.class+
                    " where targetId = ? and name like ?",
                    new Object[]{ new Integer(targetId), pattern },
                    new Type[]{ Hibernate.INTEGER, Hibernate.STRING });
            for (int i = 0; i < attributeObjects.size(); i++) {
                Attribute attribute = (Attribute)attributeObjects.get(i);
                String name = attribute.getName();
                if (StringUtils.isNotEmpty(prefix)) {
                    name = name.replaceAll("^"+prefix, "");
                }
                attributes.put(name, attribute.getValue());
            }
            return attributes;
        } catch (RuntimeException e) {
            throw e;
        } catch (HibernateException e) {
View Full Code Here

public class AttributeRepositoryImpl implements AttributeRepository {
    public void setAttribute(int targetId, String name, String value) throws RepositoryException {
        try {
            final Session session = ThreadSession.get();
            final Attribute attribute = new Attribute(targetId, name, value);
            List existingAttributes = session.find("from a in "+Attribute.class+
                    " where targetId = ? and name= ?",
                    new Object[]{ new Integer(targetId), name },
                    new Type[]{ Hibernate.INTEGER, Hibernate.STRING });
            if (existingAttributes.size() == 0) {
View Full Code Here

    }

    public String getAttribute(int targetId, String name) throws RepositoryException {
        try {
            final Session session = ThreadSession.get();
            final Attribute id = new Attribute(targetId, name, null);
            Attribute attribute = (Attribute)session.load(Attribute.class, id);
            return attribute.getValue();
        } catch (net.sf.hibernate.ObjectNotFoundException e) {
            return null;
        } catch (RuntimeException e) {
            throw e;
        } catch (HibernateException e) {
View Full Code Here

            List attributeObjects = session.find("from a in "+Attribute.class+
                    " where targetId = ? and name like ?",
                    new Object[]{ new Integer(targetId), pattern },
                    new Type[]{ Hibernate.INTEGER, Hibernate.STRING });
            for (int i = 0; i < attributeObjects.size(); i++) {
                Attribute attribute = (Attribute)attributeObjects.get(i);
                String name = attribute.getName();
                if (StringUtils.isNotEmpty(prefix)) {
                    name = name.replaceAll("^"+prefix, "");
                }
                attributes.put(name, attribute.getValue());
            }
            return attributes;
        } catch (RuntimeException e) {
            throw e;
        } catch (HibernateException e) {
View Full Code Here

TOP

Related Classes of org.nxplanner.domain.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.