StructuresSessionBean.java :  » Game » kaddath » fr » kaddath » apps » saepejb » sessionbeans » Android Open Source

Android Open Source » Game » kaddath 
kaddath » fr » kaddath » apps » saepejb » sessionbeans » StructuresSessionBean.java
package fr.kaddath.apps.saepejb.sessionbeans;

import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import fr.kaddath.apps.saepejb.models.Structure;
import fr.kaddath.apps.saepejb.models.db.ReportingInterceptor;

@Stateless
public class StructuresSessionBean implements StructuresBeanLocal,StructuresBeanRemote {

  @PersistenceContext(unitName = "SAEP-ejbPU")
  private EntityManager em;
  
  @Interceptors(ReportingInterceptor.class)
  public void saveStructure(Structure structure) {
    
    em.persist(structure);
    
  }

  public Structure getStructureById(String id) {
    return em.find(Structure.class,id);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.