java - Parse exception when overriding annotation sequence generator with generic generator in orm file -
i have entity mapped jpa annotations , sequence generator.
it's external component don't have permission change, so, tried change using orm.xml file.
when put 'generic-generator' tag, have parse exception.
here entity
@id @sequencegenerator(name = "name", sequencename = "seq", allocationsize = 1) @generatedvalue(strategy = generationtype.sequence, generator = "name") @column(name = "seq") private long id;
this entity mapped in orm.xml file
<entity class="entity" > <table name="test"/> <attributes> <id name="ido"> <column name="seq" /> <generated-value generator="teste"/> <generic-generator name="teste" strategy="org.hibernate.id.sequencegenerator"/> </id> </attributes> </entity>
my exception
caused by: org.xml.sax.saxparseexception; linenumber: 20; columnnumber: 89; cvc-complex-type.2.4.a: detected invalid content starting element 'generic-generator'. expected '{"http://xmlns.jcp.org/xml/ns/persistence/orm":temporal, "http://xmlns.jcp.org/xml/ns/persistence/orm":table-generator, "http://xmlns.jcp.org/xml/ns/persistence/orm":sequence-generator}'.
if use sequence generator in orm file, have no problem.
i'm using version 2.1 of orm schema. update hibernate dependencies 5.2.0.final problem persists
wiki
Comments
Post a Comment