@ SuppressWarnings ( "unchecked" ) public < T > DomainObjectMatch < T > createMatchFor ( T domainObject ) { DomainObjectMatch < T > ret ; if ( domainObject . getClass ( ) . equals ( DomainObject . class ) ) { // generic model List < DomainObject > source = new ArrayList < DomainObject > ( ) ; source . add ( ( DomainObject ) domainObject ) ; String typeName = ( ( DomainObject ) domainObject ) . getDomainObjectType ( ) . getName ( ) ; ret = ( DomainObjectMatch < T > ) createGenMatchForInternal ( source , typeName ) ; } else { List < T > source = new ArrayList < T > ( ) ; source . add ( domainObject ) ; ret = this . createMatchForInternal ( source , ( Class < T > ) domainObject . getClass ( ) ) ; } DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( ret ) ; DomainObjectMatch < ? > match = delegate != null ? delegate : ret ; QueryRecorder . recordAssignment ( this , "createMatchFor" , match , QueryRecorder . reference ( domainObject ) ) ; return ret ; }
Create a match for a domain object which was retrieved by another query