If you are using root.as(CustomerEvent.class), why not just query on CustomerEvent? Only CustomerEvent instances can have CustomerEvent.customer.id = 123 or you wouldn't need to use the 'as' function.
'As' was deprecated and JPA's Treat predicate (included in EclipseLink 2.5.1) should be used instead - the difference is that treat will exclude non-customerEvent instances within that predicate while 'as' only cast the predicate, and so was more difficult to use and not as stable. Treat allows you to safely use more complex expressions such as "Select event from Event event where (treat(event as CustomerEvent).customer.id = 123) or event.somethingelse = someotherCondition"