Hello,
I create a package-info.java and configure hibernate.cfg.xml to map it:
Code:
<mapping package="visualcontrol.model.entity"/>
But, after I do this I get NullPointerException:
Quote:
Caused by: java.lang.NullPointerException at org.hibernate.annotations.common.reflection.java.JavaAnnotationReader
.isAnnotationPresent(JavaAnnotationReader.java:27) at org.hibernate.annotations.common.reflection.java.JavaXAnnotatedElemen
t.isAnnotationPresent(JavaXAnnotatedElement.java:43) at org.hibernate.cfg.AnnotationBinder.bindPackage(AnnotationBinder.java:
220) at org.hibernate.cfg.AnnotationConfiguration.addPackage(AnnotationConfig
uration.java:165) at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(Annotat
ionConfiguration.java:593)
at rg.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav
a:1561)
at rg.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
This is the code for package-info.java:
Code:
@org.hibernate.annotations.TypeDefs({
@org.hibernate.annotations.TypeDef(name = "CondicaoPagamentoTipoType",
typeClass = visualcontrol.model.CondicaoPagamentoTipoUserType.class,
parameters = {
@org.hibernate.annotations.Parameter(name = "compra", value = "C"),
@org.hibernate.annotations.Parameter(name = "venda", value = "V"),
@org.hibernate.annotations.Parameter(name = "ambos", value = "A"),
@org.hibernate.annotations.Parameter(name = "nullConstant", value = "ambos")
}),
@org.hibernate.annotations.TypeDef(name = "EntityStatusType",
typeClass = visualcontrol.model.EntityStatusUserType.class,
parameters = {
@org.hibernate.annotations.Parameter(name = "NORMAL", value = "S"),
@org.hibernate.annotations.Parameter(name = "CANCELADO", value = "C"),
@org.hibernate.annotations.Parameter(name = "nullConstant", value = "NORMAL")
}),
@org.hibernate.annotations.TypeDef(name = "OrigemEstoqueType",
typeClass = visualcontrol.model.OrigemEstoqueUserType.class,
parameters = {
@org.hibernate.annotations.Parameter(name = "PRONTA_ENTREGA", value = "0"),
@org.hibernate.annotations.Parameter(name = "PROGRAMADO", value = "1"),
@org.hibernate.annotations.Parameter(name = "nullConstant", value = "PROGRAMADO")
}),
@org.hibernate.annotations.TypeDef(name = "SimNaoChar",
typeClass = visualcontrol.model.BooleanCharUserType.class,
parameters = {
@org.hibernate.annotations.Parameter(name = "stringNull", value = "N"),
@org.hibernate.annotations.Parameter(name = "stringTrue", value = "S"),
@org.hibernate.annotations.Parameter(name = "stringFalse", value = "N")
}),
@org.hibernate.annotations.TypeDef(name = "SimNaoChar_NullSim",
typeClass = visualcontrol.model.BooleanCharUserType.class,
parameters = {
@org.hibernate.annotations.Parameter(name = "stringNull", value = "S"),
@org.hibernate.annotations.Parameter(name = "stringTrue", value = "S"),
@org.hibernate.annotations.Parameter(name = "stringFalse", value = "N")
}),
@org.hibernate.annotations.TypeDef(name = "TipoPessoaType",
typeClass = visualcontrol.model.PessoaTipoUserType.class,
parameters = {
@org.hibernate.annotations.Parameter(name = "FISICA", value = "F"),
@org.hibernate.annotations.Parameter(name = "JURIDICA", value = "J")
})
})
package visualcontrol.model.entity;
What's is wrong?