用\\:替换。
比如:
String sql = "select location.ToString() a,version,location.STDistance(geometry\\:\\:STGeomFromText('POINT(-22 60)', 4326)) b from spatial_event";
Query query = em.createNativeQuery(sql);
query.getResultList();
Encountered a duplicated sql alias [] during auto-discovery of a native-sql query:
这是由于select字段没有指定别名,加个别名就行。