Created
May 9, 2011 13:19
-
-
Save thbkrkr/962502 to your computer and use it in GitHub Desktop.
Component generated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [GENERATED] | |
package pim.integ.mandarine.associationnaire; | |
import javax.annotation.Resource; | |
import javax.ejb.SessionContext; | |
import javax.ejb.Stateless; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import fr.mm.foundation.core.component.AbstractCrudHibernateEnterpriseBusinessComponent; | |
import fr.mm.foundation.core.criteria.LoadCriteria; | |
import fr.mm.foundation.utils.CriteriaUtils; | |
import pim.integ.mandarine.IEBSConstants; | |
import pim.integ.mandarine.IMandarineEBSQuartier.IAssociationNaireComponentQuartier; | |
import pim.integ.mandarine.IMandarineEBSSI.IAssociationNaireComponentSI; | |
import pim.integ.mandarine.associationnaire.domaine.ParentAssocN; | |
@Stateless | |
public class AssociationNaireComponent extends AbstractCrudHibernateEnterpriseBusinessComponent<ParentAssocN> | |
implements IAssociationNaireComponentQuartier, IAssociationNaireComponentSI | |
{ | |
// [DEBUT:ATTRIBUT] | |
// [FIN:ATTRIBUT] | |
@Override | |
public ParentAssocN loadParent(Long id) | |
// [DEBUT:METHODE - 12345678-1234-1234-1234-123456789012] | |
{ | |
return loadById(id); | |
} | |
// [FIN:METHODE - 12345678-1234-1234-1234-123456789012] | |
@Override | |
public ParentAssocN loadParentEnfants(Long id) | |
{ | |
// [DEBUT:METHODE - 12345678-1234-1234-1234-123456789012] | |
String[] relations = new String[] { "enfants" }; | |
LoadCriteria criteres = CriteriaUtils.createLoadCriteria(id, relations); | |
return load(criteres); | |
// [FIN:METHODE - 12345678-1234-1234-1234-123456789012] | |
} | |
// [DEBUT:METHODES] | |
// [FIN:METHODES] | |
@PersistenceContext(unitName = IEBSConstants.PU) | |
private EntityManager entityManager; | |
@Override | |
protected EntityManager getEntityManager() | |
{ | |
return entityManager; | |
} | |
public AssociationNaireComponent() | |
{ | |
super(); | |
rootValidator.register(ParentAssocN.class, new ParentAssocNValidator(rootValidator)); | |
} | |
@Resource | |
SessionContext sessionContext; | |
public String getUsername() | |
{ | |
return sessionContext.getCallerPrincipal().getName(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment