/** * Retrieves the class names and the attribute names mapped to their types that are used in the * constructor expressions defined in the <code><b>SELECT</b></code> clause. * <p> * For instance, from the following JPQL query: * <p> * <pre><code> SELECT new test.example.Address(a.streetName, a.zipcode) * FROM Address a</code></pre> * <p> * The return object is * <pre><code> test.example.Address * |- BasicMapping(streetName) : String * |- BasicMapping(zipcode) : int</code></pre> * * @param session The {@link AbstractSession} is used to retrieve the mappings used in the * constructor items * @return The holder of the result */ public ConstructorQueryMappings getConstructorQueryMappings(AbstractSession session, DatabaseQuery query) { JPQLQueryContext queryContext = new JPQLQueryContext(query, jpqlGrammar); ConstructorQueryMappings mappings = new ConstructorQueryMappings(query); mappings.populate(jpqlGrammar); return mappings; }
/** * Retrieves the class names and the attribute names mapped to their types that are used in the * constructor expressions defined in the <code><b>SELECT</b></code> clause. * <p> * For instance, from the following JPQL query: * <p> * <pre><code> SELECT new test.example.Address(a.streetName, a.zipcode) * FROM Address a</code></pre> * <p> * The return object is * <pre><code> test.example.Address * |- BasicMapping(streetName) : String * |- BasicMapping(zipcode) : int</code></pre> * * @param session The {@link AbstractSession} is used to retrieve the mappings used in the * constructor items * @return The holder of the result */ public ConstructorQueryMappings getConstructorQueryMappings(AbstractSession session, DatabaseQuery query) { JPQLQueryContext queryContext = new JPQLQueryContext(query, jpqlGrammar); ConstructorQueryMappings mappings = new ConstructorQueryMappings(query); mappings.populate(jpqlGrammar); return mappings; }