r2018 - trunk/topia-persistence/src/main/java/org/nuiton/topia/framework
Author: fdesbois Date: 2010-06-15 17:07:57 +0200 (Tue, 15 Jun 2010) New Revision: 2018 Url: http://nuiton.org/repositories/revision/topia/2018 Log: [TopiaQuery] Improve addFetch javadoc Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java Modified: trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java =================================================================== --- trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java 2010-06-15 08:24:25 UTC (rev 2017) +++ trunk/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaQuery.java 2010-06-15 15:07:57 UTC (rev 2018) @@ -617,18 +617,22 @@ /** * Used to load properties during query execution using FETCH keyword. This * keyword is used in a JOIN, so the alias is needed to identify properties - * to load. If no mainAlias is defined in the query, all properties will - * automatically have a generated alias to identify them. Also an empty - * SELECT statement will be defined to retrieve the correct entity depends - * on the mainEntity type in the query. Carefull using addFetch, hibernate - * doesn't support more than 3 or 4 join. In this case, you can use {@link - * #addLoad(String...)} or load manually the entities wanted. + * to load. + * </p> + * Also an empty SELECT statement will be defined to retrieve the correct + * entity depends on the mainEntity type in the query. Carefull using + * addFetch, hibernate doesn't support more than 3 or 4 join. In this case, + * you can use {@link #addLoad(String...)} or load manually the entities + * wanted. * * @param properties Properties to load during query execution * @return the TopiaQuery */ public TopiaQuery addFetch(String... properties) { + // Note : creating alias is not very efficient if other parameters is needed + // Maybe the solution is to throw an exception if no mainAlias is defined + // Check mainAlias, necessary to use join fetch boolean needAlias = false; if (StringUtils.isEmpty(mainAlias)) {
participants (1)
-
fdesbois@users.nuiton.org