It goes in the deployment descriptor; one of those values that the bean provider generally specifies.
Any given ejbSelect that returns object references must support either remote objects, or local objects, but not both ('both' isn't a value you can put in that field in the DD).
You are right. There is a "result-type-mapping" tag. Although it is optional, the default is local. I was misled by the following (HF
EJB P408): "As if by magic, the container knows which interface view to return, local or remote, depending on whether the invocation of the query came from a home or remote interface" or wasn't I?
Note that this remote-or-local-not-both limitation doesn't apply to the find methods. Finders will automatically provide remote object references when you are using a remote home interface, and local object references when you are using a local home interface.
How do you differentiate a select from a find in the deployment descriptor. Aren't they both declared in "query" tag?