Repository: gora Updated Branches: refs/heads/master 0778e5671 -> 4ac1171d8
GORA-331 add missing enum.vm template for compiler | by Damien Raude-Morvan Project: http://git-wip-us.apache.org/repos/asf/gora/repo Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/148ca981 Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/148ca981 Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/148ca981 Branch: refs/heads/master Commit: 148ca981db5e2abbfbd128b5a8419ec5344ffdc7 Parents: 0778e56 Author: Henry Saputra <[email protected]> Authored: Thu Jun 12 09:52:32 2014 -0700 Committer: Henry Saputra <[email protected]> Committed: Thu Jun 12 09:52:32 2014 -0700 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../org/apache/gora/compiler/templates/enum.vm | 35 ++++++++++++++++++++ 2 files changed, 37 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/gora/blob/148ca981/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 7271006..870e19b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,8 @@ Current Development 0.5-SNAPSHOT +* GORA-331 Gora 0.4 compiler crash with "enum" type (drazzib aka Damien Raude-Morvan via hsaputra) + * GORA-336 MongoFilterUtil: missing ref link when creating new instance of factory (drazzib via lewismc) * GORA-260 Make Solrj solr server impl configurable from within gora.properties (lewismc) http://git-wip-us.apache.org/repos/asf/gora/blob/148ca981/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm ---------------------------------------------------------------------- diff --git a/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm b/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm new file mode 100644 index 0000000..bba40bd --- /dev/null +++ b/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm @@ -0,0 +1,35 @@ +## +## Licensed to the Apache Software Foundation (ASF) under one +## or more contributor license agreements. See the NOTICE file +## distributed with this work for additional information +## regarding copyright ownership. The ASF licenses this file +## to you under the Apache License, Version 2.0 (the +## "License"); you may not use this file except in compliance +## with the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +#if ($schema.getNamespace()) +package $schema.getNamespace(); +#end +@SuppressWarnings("all") +#if ($schema.getDoc()) +/** $schema.getDoc() */ +#end +#foreach ($annotation in $this.javaAnnotations($schema)) +@$annotation +#end [email protected] +public enum ${this.mangle($schema.getName())} { + #foreach ($symbol in ${schema.getEnumSymbols()})${this.mangle($symbol)}#if ($velocityHasNext), #end#end + ; + public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("${this.javaEscape($schema.toString())}"); + public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } +} +
