Example usage for org.springframework.beans BeanUtils copyProperties

List of usage examples for org.springframework.beans BeanUtils copyProperties

Introduction

In this page you can find the example usage for org.springframework.beans BeanUtils copyProperties.

Prototype

public static void copyProperties(Object source, Object target) throws BeansException 

Source Link

Document

Copy the property values of the given source bean into the target bean.

Usage

From source file:com.kiroule.jpetstore.vaadinspring.domain.OrderDetails.java

public OrderDetails(Account account) {
    BeanUtils.copyProperties(account, this);
}

From source file:com.googlecode.starflow.engine.event.support.ActivityStartRuleUtil.java

/**
 * ?//from ww  w .  ja v a2s. co  m
 * 
 * @param event
 * @return
 */
public static boolean isStartActivity(AbstractFlowEvent event, ActivityInst activityInst) {
    boolean isStart = true;
    ActivityElement activityElement = event.getProcessElement().getActivitys()
            .get(activityInst.getActivityDefId());

    if (logger.isDebugEnabled()) {
        logger.debug("?{}?{}", activityElement.getName(),
                activityElement.getActivateRuleType());
    }

    if (Constants.ACT_ACTIVATE_RULE_WAIT.equalsIgnoreCase(activityElement.getActivateRuleType()))
        isStart = false;
    else if (Constants.ACT_ACTIVATE_RULE_LOGIC.equalsIgnoreCase(activityElement.getActivateRuleType())) {
        String beanName = activityElement.getStartStrategybyAppAction();

        try {
            ProcessInstance cloneProcessInstance = new ProcessInstance();
            BeanUtils.copyProperties(event.getProcessInstance(), cloneProcessInstance);
            ActivityInst cloneActivityInst = new ActivityInst();
            BeanUtils.copyProperties(activityInst, cloneActivityInst);
            isStart = executeActivateRule(beanName, cloneProcessInstance, cloneActivityInst);
        } catch (Exception e) {
            throw new ProcessEngineException("", e);
        }
    }

    return isStart;
}

From source file:org.wallride.web.controller.admin.category.CategoryEditForm.java

public static CategoryEditForm fromDomainObject(Category category) {
    CategoryEditForm form = new CategoryEditForm();
    BeanUtils.copyProperties(category, form);
    return form;//from   w  w w .  j  a  v  a 2 s  .c o  m
}

From source file:com.jiwhiz.rest.site.UserProfileResource.java

public UserProfileResource(UserAccount account) {
    BeanUtils.copyProperties(account, this);
}

From source file:technology.tikal.customers.model.GroupOfy.java

@Override
public void update(Group source) {
    BeanUtils.copyProperties(source, this);
}

From source file:de.ingrid.interfaces.csw.admin.command.TestSuiteHarvesterCommandObject.java

public TestSuiteHarvesterCommandObject(HarvesterConfiguration config) {
    super();
    BeanUtils.copyProperties(config, this);
}

From source file:org.openhie.openempi.service.UserExistsExceptionTest.java

public void testAddExistingUser() throws Exception {
    logger.debug("entered 'testAddExistingUser' method");
    assertNotNull(manager);//  ww w.j  a  v a  2 s. c  o  m

    User user = manager.getUser("-1");

    // create new object with null id - Hibernate doesn't like setId(null)
    User user2 = new User();
    BeanUtils.copyProperties(user, user2);
    user2.setId(null);
    user2.setVersion(null);
    user2.setRoles(null);

    // try saving as new user, this should fail b/c of unique keys
    try {
        manager.saveUser(user2);
        fail("Duplicate user didn't throw UserExistsException");
    } catch (UserExistsException uee) {
        assertNotNull(uee);
    }
}

From source file:de.ingrid.interfaces.csw.admin.command.HarvesterCommandObject.java

public HarvesterCommandObject(HarvesterConfiguration config) {
    super();
    BeanUtils.copyProperties(config, this);
}

From source file:cz.cvut.kbss.wpa.dto.PlayerDTO.java

public PlayerDTO(Long id, String username, String password, String name, String surname, Integer weigth,
        Integer height, Date dateOfBirth, List<NoteDTO> notes, List<EnrollDTO> enrolls) {
    super(id, username, password);
    this.name = name;
    this.surname = surname;
    this.weigth = weigth;
    this.Height = height;
    this.dateOfBirth = dateOfBirth;
    this.notes = notes;
    this.enrolls = enrolls;
    BeanUtils.copyProperties(surname, height);
}

From source file:org.nebula.service.admin.EnableRegistrationProcessor.java

public EnableRegistrationResponse processInternal(EnableRegistrationRequest request) {
    registrationMapper.enable(request.getId(), request.isEnabled());

    EnableRegistrationResponse response = new EnableRegistrationResponse();

    BeanUtils.copyProperties(request, response);

    return response;
}