Actually here's option 3 and this is what I'd do:
I suppose you don't call the entities dirrectly from the client, especially if you are updating to EJB 2.0. So if you have any kind of facade (session facade,message facade,ejbcommand,POJOs) the code should be:
inside the facade object:
findByUserGroupName(
String groupName){
....
Collection col = entityLocal.findByUserGroupName(groupName.toUpperCase());
and the EJB-QL inside the entity bean's method should be:
SELECT OBJECT (u) FROM UserEntity AS u WHERE (LOCATE(u.groupName,?1) <> 0)
This LOCATE function is available in EJB-QL from EJB 2.0 and returns a value different from 0 if first parameter is found inside second parameter. It is pretty much like LIKE expressions.
I would advice using this method because if you use extensions of EJB-QL from an application server you are bound to that app server (even that version of the application server).