We're updating the issue view to help you get more done. 

@UniqueConstraint(columnNames="") causes StringIndexOutOfBoundsException

Description

Empty string in columnNames attribute causes StringIndexOutOfBoundsException:

@Entity
@Table( name="items", uniqueConstraints=@UniqueConstraint(columnNames="") )
public class Item implements Serializable { ... }

---------------
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:686)
at org.hibernate.mapping.Column.setName(Column.java:84)
at org.hibernate.mapping.Column.<init>(Column.java:65)
at org.hibernate.cfg.AnnotationConfiguration.buildUniqueKeyFromColumnNames(AnnotationConfiguration.java:591)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:348)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)

Environment

None

Status

Assignee

Brett Meyer

Reporter

Ondra Žižka

Components

Fix versions

Affects versions

3.3.0.GA

Priority

Trivial