Examples of UUID


Examples of org.internna.iwebmvc.model.UUID

        Object o = null;
        if (StringUtils.hasText(text)) {
            try {
                String[] parts = StringUtils.split(text, ";");
                Class<? extends AbstractHierarchyNode> hierarchyNodeClass = ClassUtils.forName(decipherer.decrypt(parts[0]));
                o = dao.find(hierarchyNodeClass, new UUID(decipherer.decrypt(parts[1]))).getHierarchy();
            } catch (Exception e) {
                if (log.isWarnEnabled()) log.warn("Could not bind Hierarchy", e);
            }
        }
        setValue(o);
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    @Test
    public void testParse() {
        assertNull(currencyParser.parse(null));
        Currency currency = new Currency();
        currency.setId(new UUID("000000aa000000aa000000aa000000aa"));
        assertEquals(currencyParser.parse(currency), currency);
        Currency currency2 = new Currency();
        currency2.setCurrency(java.util.Currency.getInstance("EUR"));
        assertNotNull(currencyParser.parse(currency2).getId());
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    }

    @Test
    public void testIsAllowed() {
        OwnedEntity entity = new OwnedEntity();
        entity.setId(new UUID("00aa00aa00aa00aa00aa00aa00aa00aa"));
        entity.addOwner((UserImpl) securityDAO.findUser("mary"));
        assertNull("john is disallowed on entities created by mary", dao.update(entity));
        assertNotNull("john is allowed on his entities", dao.update(dao.first(OwnedEntity.class)));
        userManager.setName("viewer");
        assertNull("viewers can't update anything", dao.update(dao.first(OwnedEntity.class)));
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    }

    public Object nullSafeGet(ResultSet rs, String[] names, Object arg2) throws HibernateException, SQLException {
        byte[] bytes = rs.getBytes(names[0]);
        if (rs.wasNull()) return null;
        return new UUID(bytes);
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

public class UUIDGenerator extends UUIDHexGenerator {

    @Override
    public Serializable generate(SessionImplementor sessionImplementor, Object object) {
      String generated = super.generate(sessionImplementor, object).toString();
        return new UUID(generated);
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

        Map<String, Object> parameters = new HashMap<String, Object>(filters.size());
        for (Filter filter : filters) {
            if (StringUtils.hasText(filter.getMinValue())) parameters.put(filter.getMin().replaceAll("\\.", "_"), filter.get(BeanUtils.getPropertyDescriptor(clazz, filter.getPath()), filter.getMinValue()));
            if (StringUtils.hasText(filter.getPathValue())) {
                String path = filter.getPath().replaceAll("\\.", "_");
                if (filter.isEntity()) parameters.put(path, new UUID(decipherer.decrypt(filter.getPathValue())));
                else parameters.put(filter.getPath().replaceAll("\\.", "_"), filter.get(BeanUtils.getPropertyDescriptor(clazz, filter.getPath()), filter.getPathValue()));
            }
        }
        return parameters;
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    @SuppressWarnings("unchecked")
    public boolean update(Class entityClass, UpdateDataDTO[] data) throws Exception {
        Assert.notNull(entityClass);
        for (UpdateDataDTO dto : data) {
            Assert.isEncrypted(decipherer, dto.getPrimaryKey());
            DomainEntity o = dao.find(entityClass, new UUID(decipherer.decrypt(dto.getPrimaryKey())));
            BeanWrapper w = new BeanWrapperImpl(o);
            w.setPropertyValue(dto.getPath(), dto.getValue());
            dao.update(o);
        }
        return true;
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    }

    @Override public Object nullSafeGet(ResultSet rs, String[] names, Object arg2) throws HibernateException, SQLException {
        byte[] bytes = rs.getBytes(names[0]);
        if (rs.wasNull()) return null;
        return new UUID(bytes);
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

        if (decipherer == null) initEncryption();
        try {
            if (data != null) {
                String id = LocalUtil.decode(data.getValue());
                Assert.isEncrypted(decipherer, id);
                return new UUID(decipherer.decrypt(id));
            }
        } catch (Exception e) {
            throw new MarshallException(paramType, new IWebMvcException("Could not convert UUID from: " + data, e));
        }
        return null;
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

*/
public class UUIDGenerator extends UUIDHexGenerator {

    @Override
    public Serializable generate(SessionImplementor sessionImplementor, Object object) {
        return new UUID(super.generate(sessionImplementor, object).toString());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.