branch develop updated (27b23d3 -> 1e31ca6)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository topia. See http://git.nuiton.org/topia.git from 27b23d3 Update to flyway 3.1, change initVersion to baselineVersion according to Flyway new practice (fixes #3587) new 3820c41 Fix generic typing issues in TopiaEntities new 1e31ca6 Fix generated SQL query remove usages in a *---* relation on entity deletion (fixes #3595) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 1e31ca6ca2a56a313425c52c78ed3097cc4804bf Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Dec 11 15:40:33 2014 +0100 Fix generated SQL query remove usages in a *---* relation on entity deletion (fixes #3595) commit 3820c41f846ef6790324064170a3283386f99b5d Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 1 17:25:50 2014 +0100 Fix generic typing issues in TopiaEntities Summary of changes: .../nuiton/topia/persistence/TopiaEntities.java | 24 ++++++++-------------- .../topia/templates/EntityDaoTransformer.java | 4 ++-- 2 files changed, 11 insertions(+), 17 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository topia. See http://git.nuiton.org/topia.git commit 3820c41f846ef6790324064170a3283386f99b5d Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 1 17:25:50 2014 +0100 Fix generic typing issues in TopiaEntities --- .../nuiton/topia/persistence/TopiaEntities.java | 24 ++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java b/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java index 340ea7c..54cf720 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/persistence/TopiaEntities.java @@ -40,26 +40,15 @@ import com.google.common.collect.Iterables; public class TopiaEntities { /** - * Guava's {@link com.google.common.base.Function} to get a topiaId from any - * {@link org.nuiton.topia.persistence.TopiaEntity} - */ - protected static final Function<TopiaEntity, String> GET_TOPIA_ID = new Function<TopiaEntity, String>() { - @Override - public String apply(TopiaEntity input) { - return input == null ? null : input.getTopiaId(); - } - }; - - /** * Creates a Guava's {@link com.google.common.base.Predicate} which tests if a * {@link org.nuiton.topia.persistence.TopiaEntity} has the given {@code topiaId} * * @param id the expected topiaId * @return the created Predicate */ - public static Predicate<TopiaEntity> entityHasId(String id) { + public static <E extends TopiaEntity> Predicate<E> entityHasId(String id) { Predicate<String> equalsPredicate = Predicates.equalTo(id); - Predicate<TopiaEntity> result = Predicates.compose(equalsPredicate, GET_TOPIA_ID); + Predicate<E> result = Predicates.compose(equalsPredicate, TopiaEntities.<E>getTopiaIdFunction()); return result; } @@ -88,8 +77,13 @@ public class TopiaEntities { * * @since 2.6.12 */ - public static Function<TopiaEntity, String> getTopiaIdFunction() { - return GET_TOPIA_ID; + public static <E extends TopiaEntity> Function<E, String> getTopiaIdFunction() { + return new Function<E, String>() { + @Override + public String apply(TopiaEntity input) { + return input == null ? null : input.getTopiaId(); + } + }; } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository topia. See http://git.nuiton.org/topia.git commit 1e31ca6ca2a56a313425c52c78ed3097cc4804bf Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Dec 11 15:40:33 2014 +0100 Fix generated SQL query remove usages in a *---* relation on entity deletion (fixes #3595) --- .../main/java/org/nuiton/topia/templates/EntityDaoTransformer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java b/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java index 054cc10..82b6b57 100644 --- a/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java +++ b/topia-templates/src/main/java/org/nuiton/topia/templates/EntityDaoTransformer.java @@ -481,9 +481,9 @@ public class EntityDaoTransformer extends ObjectModelTransformerToJava { body.append("" /*{ { - String sql = "SELECT main.topiaid " + + String sql = "SELECT main.* " + " FROM <%=attrClassifierDBName%> main, <%=attrJoinTableName%> secondary " + - " WHERE main.topiaid=secondary.<%=attrDBName%> " + + " WHERE main.topiaId=secondary.<%=attrDBName%> " + " AND secondary.<%=attrReverseDBName%>='" + entity.getTopiaId() + "'"; List<<%=attrType%>> list = hibernateSession .createSQLQuery(sql) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm