📄 eqlagentstub.java
字号:
Number fieldValue ) { EQLReqField reqField = getReqField( entity, fieldName ); if( reqField == null ) { return null; } EQLObject o; if( fieldValue != null ) { o = new EQLNumberObject( fieldValue ); } else { o = EQLNullObject.getInstance(); } return new EQLResCell( reqField, o ); } // // Get new Boolean cell or NULL if <code>fieldName</code> not found. // protected EQLResCell getBooleanCell( Entity entity, String fieldName, Boolean fieldValue ) { EQLReqField reqField = getReqField( entity, fieldName ); if( reqField == null ) { return null; } EQLObject o; if( fieldValue != null ) { o = new EQLNumberObject( fieldValue.booleanValue() ? new Integer( 1 ) : new Integer( 0 ) ); } else { o = EQLNullObject.getInstance(); } return new EQLResCell( reqField, o ); } // // Get new String cell or NULL if <code>fieldName</code> not found. // protected EQLResCell getStringCell( Entity entity, String fieldName, String fieldValue ) { EQLReqField reqField = getReqField( entity, fieldName ); if( reqField == null ) { return null; } EQLObject o; if( fieldValue != null ) { o = new EQLStringObject( fieldValue ); } else { o = EQLNullObject.getInstance(); } return new EQLResCell( reqField, o ); } // // Get new String ListRef cell or NULL. // protected EQLResCell getStringListCell( EQLSession eqlSession, EQLResCell cell, String listFieldValue ) { EQLReqField listReqField = getListReqField( eqlSession, cell.getReqField().getField() ); if( listReqField == null ) { return null; } EQLObject o; if( listFieldValue != null ) { o = new EQLStringObject( listFieldValue ); } else { o = EQLNullObject.getInstance(); } return new EQLResCell( listReqField, o ); } // // Get new Memo cell or NULL if <code>fieldName</code> not found. // protected EQLResCell getMemoCell( Entity entity, String fieldName, String fieldValue ) { EQLReqField reqField = getReqField( entity, fieldName ); if( reqField == null ) { return null; } EQLObject o; if( fieldValue != null ) { o = new EQLMemoObject( fieldValue.toCharArray() ); } else { o = EQLNullObject.getInstance(); } return new EQLResCell( reqField, o ); } // // Get new Date cell or NULL if <code>fieldName</code> not found. // protected EQLResCell getDateCell( Entity entity, String fieldName, Date fieldValue ) { EQLReqField reqField = getReqField( entity, fieldName ); if( reqField == null ) { return null; } EQLObject o; if( fieldValue != null ) { o = new EQLDateObject( fieldValue ); } else { o = EQLNullObject.getInstance(); } return new EQLResCell( reqField, o ); } // // Construct/Take from cache EQLReqField object or return NULL // if no field found in entity // protected EQLReqField getReqField( Entity entity, String fieldName ) { // try to find in cache String id = EntityHelper.getFieldId( entity.getName(), fieldName ); EQLReqField reqField = ( EQLReqField ) reqFieldCache.get( id ); if( reqField == null ) { // create new object and remember instance in cache try { reqField = new EQLReqField( entity, EntityHelper.getEfield( fieldName, entity ) ); reqFieldCache.put( id, reqField ); } catch( UnknownEfieldException e ) { // field not found - return NULL return null; } } // ok return reqField; } // // Constructs new List EQLReqField object or return NULL // if no List field found in entity // protected EQLReqField getListReqField( EQLSession eqlSession, Efield masterField ) { Listref listref = masterField.getListref(); if( listref == null ) { return null; } // try to find in cache String id = EntityHelper.getFieldId( listref.getEntity(), listref.getEfield() ); EQLReqField lreqField = ( EQLReqField ) reqFieldCache.get( id ); if( lreqField == null ) { // create new object and remember instance in cache try { Entity lrefEntity = eqlSession.findEntity( listref.getEntity() ); Efield lrefField = EntityHelper.getEfield( listref.getEfield(), lrefEntity ); lreqField = new EQLReqField( lrefEntity, lrefField ); reqFieldCache.put( id, lreqField ); } catch( UnknownEfieldException e ) { // field not found - return NULL return null; } } // ok return lreqField; } // // Constructs new List EQLResCell or take it from the cache. // This method calls EQLManager EJB. // protected EQLResCell getListResCell( EQLSession eqlSession, EQLResRecord resRecord, EQLResCell masterResCell ) throws EQLException { EQLReqField listReqField = getListReqField( eqlSession, masterResCell.getReqField().getField() ); if( listReqField == null ) { return null; } Object pkey = masterResCell.getEQLObject().getObject(); return getListResCell( eqlSession, resRecord, masterResCell, listReqField, pkey ); } // // Constructs new List EQLResCell or take it from the cache. // This method calls EQLManager EJB. // protected EQLResCell getListResCell( EQLSession eqlSession, EQLResRecord resRecord, EQLResCell masterResCell, EQLReqField listReqField, Object pkey ) throws EQLException { LogonSession ls = eqlSession.getLogonSession(); EQLManagerLocal local = ( EQLManagerLocal ) eqlSession.getCOM(). getLocalObject( JNDINames.EQLManager, EQLManagerLocalHome.class ); return EQLUtils.getListResCell( resRecord, masterResCell, listReqField, pkey, ls, local ); } /** * Throws UserQueryParseException exception. * * @param eqlSession EQLSession * @param res EQLERes * @param fieldName Efield name * @param value incorrect field value * @param comments optional comment * @throws UserQueryParseException */ protected void throwUserQueryParseException( EQLSession eqlSession, EQLERes res, String fieldName, String value, String comments ) throws UserQueryParseException { Entity entity = res.getEntity(); String entityName = entity.getName(); String langID = eqlSession.getLogonSession().getUser().getLangID(); CustomConfigManagerLocal customManager = ( CustomConfigManagerLocal ) eqlSession.getCOM().getLocalObject( JNDINames.CustomConfigManager, CustomConfigManagerLocalHome.class ); CustomField customField = customManager.getLocalizedCustomField( langID, entityName, fieldName ); String caption = customField.getCaption(); throw new UserQueryParseException( value, entityName, caption, comments ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -