PDA

View Full Version : there is issue to call doMapFromContext



dhkim911
Nov 8th, 2007, 01:26 PM
All

I have issue to call doMapFromContext below code.
it ssems AbstractContextMapper didn't call doMapFromContext.
Can someone help me to fix this?

Thanks


output is only This VZWMODLdapContextMapper

--------------------------------------------------------------------------

protected ContextMapper getContextMapper() {
System.out.println("This VZWMODLdapContextMapper");
return new VLdapContextMapper();
}

private class VdapContextMapper extends AbstractContextMapper {

@Override
protected Object doMapFromContext(DirContextOperations arg0) {
System.out.println("This doMapFromContext");
return null;
}

rasky
Nov 9th, 2007, 12:23 AM
I don't think I quite understand. The doMapFromContext() method will be called from AbstractContextMapper.mapFromContext().

In your example that would mean that if you supply an instance of your AbstractContextMapper implementation to a search, "This doMapFromContext" will be printed once for each row matching your search. Nothing will be printed just by instantiating the class. Please clarify.

dhkim911
Nov 9th, 2007, 04:13 AM
I don't think I quite understand. The doMapFromContext() method will be called from AbstractContextMapper.mapFromContext().

In your example that would mean that if you supply an instance of your AbstractContextMapper implementation to a search, "This doMapFromContext" will be printed once for each row matching your search. Nothing will be printed just by instantiating the class. Please clarify.

Thanks for response

This is test code to call doMapFromContext().
As you explained, The doMapFromContext() method will be called from AbstractContextMapper.mapFromContext().
my code has not been worked.