Package org.springbyexample.schema.beans.person

Examples of org.springbyexample.schema.beans.person.Person


    @RequestMapping(value = FIND_BY_ID_REQUEST, method = RequestMethod.GET)
    public PersonResponse findById(@PathVariable(ID_VAR) long id) {
        logger.info("Find person.  id={}", id);

        return new PersonResponse()
                    .withResult(new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME));
    }
View Full Code Here


                                   @PathVariable(PAGE_SIZE_VAR) int pageSize) {
        logger.info("Find person page.  page={}  pageSize={}", page, pageSize);

        return new PersonFindResponse()
                    .withCount(2)
                    .withResults(new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME),
                                 new Person().withId(SECOND_ID).withFirstName(SECOND_FIRST_NAME).withLastName(SECOND_LAST_NAME));
    }
View Full Code Here

    public PersonFindResponse find() {
        logger.info("Find all persons.");

        return new PersonFindResponse()
                    .withCount(2)
                    .withResults(new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME),
                                 new Person().withId(SECOND_ID).withFirstName(SECOND_FIRST_NAME).withLastName(SECOND_LAST_NAME));
    }
View Full Code Here

        verifyRecord(response.getResults().get(0));
    }

    @Test
    public void testSave() {
        Person request = new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME);
       
        PersonResponse response = client.save(request);
       
        assertNotNull("Response is null.", response);
       
View Full Code Here

        return client;
    }

    @Override
    protected Person generateCreateRequest() {
        return new Person().withFirstName(FIRST_NAME).withLastName(LAST_NAME);
    }
View Full Code Here

        return request.withLastName(NEW_LAST_NAME);
    }

    @Override
    protected Person generateDeleteRequest() {
        return new Person().withId(id);
    }
View Full Code Here

@Component
public class SmallContactConverter extends AbstractListConverter<Person, Person> {

    @Override
    public Person convertTo(Person source) {
        Person result = new Person()
                .withId(source.getId())
                .withFirstName(source.getFirstName())
                .withLastName(source.getLastName())
                .withLockVersion(source.getLockVersion());
//                .withCreateUser(source.getCreateUser())
View Full Code Here

        return client;
    }

    @Override
    protected Person generateCreateRequest() {
        return new Person().withFirstName(FIRST_NAME).withLastName(LAST_NAME);
    }
View Full Code Here

        return request.withLastName(NEW_LAST_NAME);
    }

    @Override
    protected Person generateDeleteRequest() {
        return new Person().withId(id);
    }
View Full Code Here

            bean = professionalConverter.convertFrom((Professional) request);
        } else {
            bean = studentConverter.convertFrom(personStudentConverter.convertTo(request));
        }

        Person result = converter.convertTo(repository.saveAndFlush(bean));

        return createSaveResponse(result);
    }
View Full Code Here

TOP

Related Classes of org.springbyexample.schema.beans.person.Person

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.