I'm trying to create a simple parent/child dataset following the example in the manual. This is what I got:
(I'm using benerator 0.7.6)
- Code: Select all
<generate type="items" count="100">
<consumer class="org.databene.platform.csv.CSVEntityExporter">
<property name="uri" value="items.csv"/>
<property name="separator" value="|"/>
<property name="encoding" value="ISO-8859-1"/>
</consumer>
<id name="item_id"/>
<attribute name="item_name" type="string" pattern="[A-Z][a-z ]{6,25}"/>
<generate type="item_details" count="100">
<consumer class="org.databene.platform.csv.CSVEntityExporter">
<property name="uri" value="item_details.csv"/>
<property name="separator" value="|"/>
<property name="encoding" value="ISO-8859-1"/>
</consumer>
<id name="item_detail_id" type="big_integer"/>
<attribute name="item_id" script="{${items.item_id}}"/>
<attribute name="sort_sequence" type="big_integer" />
</generate>
</generate>
- Code: Select all
11:18:56,921 DEBUG (main) [CONFIG] Initializing Script mapping from file org/databene/script/script.properties
line 1:0 no viable alternative at character '$'
Exception in thread "main" Error parsing Benerator Script expression at line 1, column 0 of ${items.id}
at org.databene.script.DatabeneScriptParser.mapToSyntaxError(DatabeneScriptParser.java:286)
at org.databene.script.DatabeneScriptParser.parseExpression(DatabeneScriptParser.java:135)
at org.databene.benerator.script.BeneratorScriptFactory.parseText(BeneratorScriptFactory.java:48)
at org.databene.script.ScriptUtil.parseScriptText(ScriptUtil.java:164)
at org.databene.script.ScriptUtil.parseScriptText(ScriptUtil.java:156)
at org.databene.script.ScriptUtil.parseScriptText(ScriptUtil.java:142)
at org.databene.benerator.factory.FactoryUtil.createScriptGenerator(FactoryUtil.java:186)
...
...
Caused by: NoViableAltException('$'@[1:1: Tokens : ( T__66 | BOOLEANLITERAL | INTLITERAL | DECIMALLITERAL | STRINGLITERAL | WS | COMMENT | L
INE_COMMENT | NULL | LPAREN | RPAREN | LBRACE | RBRACE | LBRACKET | RBRACKET | SEMI | COMMA | DOT | EQ | BANG | TILDE | QUES | COLON | EQEQ
| AMPAMP | BARBAR | PLUS | SUB | STAR | SLASH | AMP | BAR | CARET | PERCENT | MONKEYS_AT | BANGEQ | GT | SHIFT_RIGHT | SHIFT_RIGHT2 | SHIFT_
LEFT | GE | LT | LE | ARROW | IDENTIFIER );])
at org.antlr.runtime.DFA.noViableAlt(DFA.java:158)
at org.antlr.runtime.DFA.predict(DFA.java:116)
at org.databene.script.antlr.DatabeneScriptLexer.mTokens(DatabeneScriptLexer.java:2057)
....
What am I missing here?
