public ModelEntity getModelEntity() { if (modelEntity == null) { if (entityName != null) modelEntity = this.getDelegator().getModelEntity(entityName); if (modelEntity == null) { throw new IllegalStateException("[GenericEntity.getModelEntity] could not find modelEntity for entityName " + entityName); } } return modelEntity; }
public void putInAllCache(String entityName, List values) { if (entityName == null || values == null) return; ModelEntity entity = this.getModelEntity(entityName); this.putInAllCache(entity, values); }
public void putInAndCache(String entityName, Map fields, List values) { if (entityName == null || fields == null || values == null) return; ModelEntity entity = this.getModelEntity(entityName); putInAndCache(entity, fields, values); }
public void putInAllCache(String entityName, List values) { if (entityName == null || values == null) return; ModelEntity entity = this.getModelEntity(entityName); this.putInAllCache(entity, values); }
public ModelEntity getModelEntity() { if (modelEntity == null) { if (entityName != null) modelEntity = this.getDelegator().getModelEntity(entityName); if (modelEntity == null) { throw new IllegalStateException("[GenericEntity.getModelEntity] could not find modelEntity for entityName " + entityName); } } return modelEntity; }
public ModelEntity getModelEntity() { if (modelEntity == null) { if (entityName != null) modelEntity = this.getDelegator().getModelEntity(entityName); if (modelEntity == null) { throw new IllegalStateException("[GenericEntity.getModelEntity] could not find modelEntity for entityName " + entityName); } } return modelEntity; }
public List getFromAndCache(String entityName, Map fields) { if (entityName == null || fields == null) return null; ModelEntity entity = this.getModelEntity(entityName); return getFromAndCache(entity, fields); }
public List getFromAndCache(String entityName, Map fields) { if (entityName == null || fields == null) return null; ModelEntity entity = this.getModelEntity(entityName); return getFromAndCache(entity, fields); }
public void putInAndCache(String entityName, Map fields, List values) { if (entityName == null || fields == null || values == null) return; ModelEntity entity = this.getModelEntity(entityName); putInAndCache(entity, fields, values); }
/** Creates a Primary Key in the form of a GenericPK without persisting it */ public GenericPK makePK(String entityName, Map fields) { ModelEntity entity = this.getModelEntity(entityName); if (entity == null) { throw new IllegalArgumentException("[GenericDelegator.makePK] could not find entity for entityName: " + entityName); } GenericPK pk = new GenericPK(entity, fields); pk.setDelegator(this); return pk; }
/** Creates a Entity in the form of a GenericValue without persisting it */ public GenericValue makeValue(String entityName, Map fields) { ModelEntity entity = this.getModelEntity(entityName); if (entity == null) { throw new IllegalArgumentException("[GenericDelegator.makeValue] could not find entity for entityName: " + entityName); } GenericValue value = new GenericValue(entity, fields); value.setDelegator(this); return value; }
/** Creates a Primary Key in the form of a GenericPK without persisting it */ public GenericPK makePK(String entityName, Map fields) { ModelEntity entity = this.getModelEntity(entityName); if (entity == null) { throw new IllegalArgumentException("[GenericDelegator.makePK] could not find entity for entityName: " + entityName); } GenericPK pk = new GenericPK(entity, fields); pk.setDelegator(this); return pk; }
/** Creates a Entity in the form of a GenericValue without persisting it */ public GenericValue makeValue(String entityName, Map fields) { ModelEntity entity = this.getModelEntity(entityName); if (entity == null) { throw new IllegalArgumentException("[GenericDelegator.makeValue] could not find entity for entityName: " + entityName); } GenericValue value = new GenericValue(entity, fields); value.setDelegator(this); return value; }
public List<GenericValue> getFromAndCache(final String entityName, final Map<String, ?> fields) { checkIfLocked(); if (entityName == null || fields == null) { return null; } ModelEntity entity = getModelEntity(entityName); return getFromAndCache(entity, fields); }
public ImmutableGenericValue(GenericDelegator delegator, String entityName, Map fields) { super(delegator.getModelEntity(entityName)); super.setDelegator(delegator); super.setFields(fields); constructed = true; }
public void putInAndCache( final String entityName, final Map<String, ?> fields, final List<? extends GenericValue> values) { checkIfLocked(); if (entityName == null || fields == null || values == null) { return; } final ModelEntity entity = getModelEntity(entityName); putInAndCache(entity, fields, values); }
public void putInAllCache(final String entityName, final List<? extends GenericValue> values) { checkIfLocked(); if (entityName == null || values == null) { return; } final ModelEntity entity = getModelEntity(entityName); putInAllCache(entity, values); }
public static void setupMockSequenceUtil() { String helperName = CoreFactory.getGenericDelegator().getEntityHelperName("SequenceValueItem"); ModelEntity seqEntity = CoreFactory.getGenericDelegator().getModelEntity("SequenceValueItem"); CoreFactory.getGenericDelegator().setSequencer(new MockSequenceUtil(helperName, seqEntity, "seqName", "seqId")); }
public static void cleanOFBiz() { MemoryHelper.clearCache(); final String helperName = CoreFactory.getGenericDelegator().getEntityHelperName("SequenceValueItem"); final ModelEntity seqEntity = CoreFactory.getGenericDelegator().getModelEntity("SequenceValueItem"); CoreFactory.getGenericDelegator().setSequencer(new MockSequenceUtil(helperName, seqEntity, "seqName", "seqId")); }
@Override public void doUpgrade(boolean setupMode) throws Exception { GenericHelper helper = getDelegator().getEntityHelper("Issue"); DatabaseUtil dbUtil = new DatabaseUtil(helper.getHelperName()); ModelEntity issueEntity = getDelegator().getModelEntity("Issue"); ModelIndex projNumIndex = new ModelIndex(); projNumIndex.setName("issue_proj_num"); projNumIndex.setMainEntity(issueEntity); projNumIndex.setUnique(true); projNumIndex.addIndexField("number"); projNumIndex.addIndexField("project"); dropIndex(dbUtil, issueEntity, projNumIndex); createIndex(dbUtil, issueEntity, projNumIndex); }