当前位置: 首页>>代码示例>>Java>>正文


Java Member类代码示例

本文整理汇总了Java中org.jboss.as.quickstarts.kitchensink.model.Member的典型用法代码示例。如果您正苦于以下问题:Java Member类的具体用法?Java Member怎么用?Java Member使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Member类属于org.jboss.as.quickstarts.kitchensink.model包,在下文中一共展示了Member类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findByEmail

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
public Member findByEmail(String email) {
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
    Root<Member> member = criteria.from(Member.class);
    // Swap criteria statements if you would like to try out type-safe criteria queries, a new
    // feature in JPA 2.0
    // criteria.select(member).where(cb.equal(member.get(Member_.name), email));
    criteria.select(member).where(cb.equal(member.get("email"), email));
    return em.createQuery(criteria).getSingleResult();
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:11,代码来源:MemberRepository.java

示例2: findAllOrderedByName

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
public List<Member> findAllOrderedByName() {
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
    Root<Member> member = criteria.from(Member.class);
    // Swap criteria statements if you would like to try out type-safe criteria queries, a new
    // feature in JPA 2.0
    // criteria.select(member).orderBy(cb.asc(member.get(Member_.name)));
    criteria.select(member).orderBy(cb.asc(member.get("name")));
    return em.createQuery(criteria).getResultList();
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:11,代码来源:MemberRepository.java

示例3: lookupMemberById

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
@GET
@Path("/{id:[0-9][0-9]*}")
@Produces(MediaType.APPLICATION_JSON)
public Member lookupMemberById(@PathParam("id") long id) {
    Member member = repository.findById(id);
    if (member == null) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
    return member;
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:11,代码来源:MemberResourceRESTService.java

示例4: emailAlreadyExists

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
/**
 * Checks if a member with the same email address is already registered. This is the only way to easily capture the
 * "@UniqueConstraint(columnNames = "email")" constraint from the Member class.
 * 
 * @param email The email to check
 * @return True if the email already exists, and false otherwise
 */
public boolean emailAlreadyExists(String email) {
    Member member = null;
    try {
        member = repository.findByEmail(email);
    } catch (NoResultException e) {
        // ignore
    }
    return member != null;
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:17,代码来源:MemberResourceRESTService.java

示例5: createTestArchive

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
@Deployment
public static Archive<?> createTestArchive() {
    return ShrinkWrap.create(WebArchive.class, "test.war")
            .addClasses(Member.class, MemberRegistration.class, Resources.class)
            .addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            // Deploy our test datasource
            .addAsWebInfResource("test-ds.xml");
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:10,代码来源:MemberRegistrationTest.java

示例6: testRegister

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
@Test
public void testRegister() throws Exception {
    Member newMember = new Member();
    newMember.setName("Jane Doe");
    newMember.setEmail("[email protected]");
    newMember.setPhoneNumber("2125551234");
    memberRegistration.register(newMember);
    assertNotNull(newMember.getId());
    log.info(newMember.getName() + " was persisted with id " + newMember.getId());
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:11,代码来源:MemberRegistrationTest.java

示例7: findByEmail

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
public Member findByEmail(String email) {
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Member> criteria = cb.createQuery(Member.class);
    Root<Member> member = criteria.from(Member.class);
    // Swap criteria statements if you would like to try out type-safe criteria queries, a new
    // feature in JPA 2.0
    // criteria.select(member).where(cb.equal(member.get(Member_.email), email));
    criteria.select(member).where(cb.equal(member.get("email"), email));
    return em.createQuery(criteria).getSingleResult();
}
 
开发者ID:wfink,项目名称:jboss-as-quickstart,代码行数:11,代码来源:MemberRepository.java

示例8: getMembers

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
@Produces
@Named
public List<Member> getMembers() {
    return members;
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:6,代码来源:MemberListProducer.java

示例9: onMemberListChanged

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
public void onMemberListChanged(@Observes(notifyObserver = Reception.IF_EXISTS) final Member member) {
    retrieveAllMembersOrderedByName();
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:4,代码来源:MemberListProducer.java

示例10: findById

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
public Member findById(Long id) {
    return em.find(Member.class, id);
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:4,代码来源:MemberRepository.java

示例11: initNewMember

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
@PostConstruct
public void initNewMember() {
    newMember = new Member();
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:5,代码来源:MemberController.java

示例12: register

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
public void register(Member member) throws Exception {
    log.info("Registering " + member.getName());
    em.persist(member);
    memberEventSrc.fire(member);
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:6,代码来源:MemberRegistration.java

示例13: listAllMembers

import org.jboss.as.quickstarts.kitchensink.model.Member; //导入依赖的package包/类
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<Member> listAllMembers() {
    return repository.findAllOrderedByName();
}
 
开发者ID:wemakestuff,项目名称:Teracast,代码行数:6,代码来源:MemberResourceRESTService.java


注:本文中的org.jboss.as.quickstarts.kitchensink.model.Member类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。