public List<String> getRestrictionExpressionStrings() { List<String> expressionStrings = new ArrayList<String>(); for (ValueExpression restriction : getRestrictions()) { expressionStrings.add(restriction.getExpressionString()); } return expressionStrings; }
protected void parseEjbql() { if (parsedEjbql==null || parsedRestrictions==null) { QueryParser qp = new QueryParser( getEjbql() ); queryParameters = qp.getParameterValueBindings(); parsedEjbql = qp.getEjbql(); List<ValueExpression> restrictionFragments = getRestrictions(); parsedRestrictions = new ArrayList<String>( restrictionFragments.size() ); restrictionParameters = new ArrayList<ValueExpression>( restrictionFragments.size() ); for ( ValueExpression restriction: restrictionFragments ) { QueryParser rqp = new QueryParser( restriction.getExpressionString(), queryParameters.size() + restrictionParameters.size() ); if ( rqp.getParameterValueBindings().size()!=1 ) { throw new IllegalArgumentException("there should be exactly one value binding in a restriction: " + restriction); } parsedRestrictions.add( rqp.getEjbql() ); restrictionParameters.addAll( rqp.getParameterValueBindings() ); } } }
private void initSession() { currentSession = session.getValue(); if (currentSession==null) { throw new IllegalStateException("session was null: " + session.getExpressionString()); } }
log.debug("adding consequence exception handler: " + consequenceExceptionHandler.getExpressionString()); RuleBaseConfiguration rbconf = new RuleBaseConfiguration(); rbconf.setConsequenceExceptionHandler(consequenceExceptionHandler.getValue().toString());
/** * Add a {@link javax.faces.application.FacesMessage} and log a message when * the entity instance is created. * * Utility method to add a {@link javax.faces.application.FacesMessage} from * the Seam managed resource bundle or, if not specified in the resource * bundle, from {@link #getUpdatedMessage()} and log the entity when the * managed entity is updated. * * @see #getCreatedMessage() * @see #getCreatedMessageKey() */ protected void createdMessage() { debug("created entity #0 #1", getEntityClass().getName(), getId()); getStatusMessages().addFromResourceBundleOrDefault( INFO, getCreatedMessageKey(), getCreatedMessage().getExpressionString() ); }
/** * Add a {@link javax.faces.application.FacesMessage} and log a message when * the entity instance is updated. * * Utility method to add a {@link javax.faces.application.FacesMessage} from * the Seam managed resource bundle or, if not specified in the resource * bundle, from {@link #getUpdatedMessage()} and log the entity when the * managed entity is updated. * * @see #getUpdatedMessage() * @see #getUpdatedMessageKey() */ protected void updatedMessage() { debug("updated entity #0 #1", getEntityClass().getName(), getId()); getStatusMessages().addFromResourceBundleOrDefault( INFO, getUpdatedMessageKey(), getUpdatedMessage().getExpressionString() ); }
/** * Add a {@link javax.faces.application.FacesMessage} and log a message when * the entity instance is deleted. * * Utility method to add a {@link javax.faces.application.FacesMessage} from * the Seam managed resource bundle or, if not specified in the resource * bundle, from {@link #getDeletedMessage()} and log the entity when the * managed entity is deleted. * * @see #getDeletedMessage() * @see #getDeletedMessageKey() */ protected void deletedMessage() { debug("deleted entity #0 #1", getEntityClass().getName(), getId()); getStatusMessages().addFromResourceBundleOrDefault( INFO, getDeletedMessageKey(), getDeletedMessage().getExpressionString() ); }
private void initEntityManager() { currentEntityManager = entityManager.getValue(); if (currentEntityManager==null) { throw new IllegalStateException("entity manager was null: " + entityManager.getExpressionString()); } }