I don't have a lot to say, but this is my little bit.

Tuesday, January 7, 2014

JPA EclipseLink ORM.XML Mapping for Index

There may be other, harder ways to do it, but here's the easy way to add an index on a column when using EclipseLink and XML mappings for JPA. Simply add an empty "index" tag inside the "basic" tag for that entity.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <entity name="MonitorEvent" class="com.webaction.runtime.MonitorEvent">
            <basic name="timeStamp">
                <index />


Someone involved with JPA (or EclipseLink) should really consider some proper XML mapping documentation, because it is not at all sufficient.

No comments:

Post a Comment