Open zhanhb opened 9 years ago
<properties>
<asm.version>5.0.4</asm.version>
<javassist.version>3.20.0-GA</javassist.version>
<spring-boot.version>1.2.5.RELEASE</spring-boot.version>
<maven.version>3.3.3</maven.version>
<liquibase-hibernate4.version>3.5</liquibase-hibernate4.version>
<liquibase.version>3.4.0</liquibase.version>
<hibernate.version>4.3.10.Final</hibernate.version>
<usertype.version>4.0.0.GA</usertype.version>
</properties>
If I put @TypeDefs on to any entity class, it works ok, but can it works I put it on to package-info???
Any progress on that? I have similar issue with
@GenericGenerator(
name = DEFAULT_GENERATOR,
strategy = SEQUENCE_STYLE_GENERATOR,
parameters = @Parameter(name = SEQUENCE_PARAM, value = "default_sequence")
)
on the package level
+1
+1 - Does Hibernate scan for annotations on interfaces ? As a quick workaround can we use
@TypeDefs({
@TypeDef(name = "type1", typeClass = foo.bar.Type1),
@TypeDef(name = "type2", typeClass = foo.bar.Type2),
@TypeDef(name = "type3", typeClass = foo.bar.Type3)
})
public interface Marker {
// nothing
}
@Entity
public class MyEntity implements Marker {
private foo.bar.Type1 type1Value;
public MyEntity() {
super();
}
@Column
public foo.bar.Type1 getSpecialType1() {
return type1Value;
}
public void setSpecialType1(foo.bar.Type1 type1Value) {
this.type1Value = type1Value;
}
}
I have a similar problem but with the @FilterDef annotation at package level.
For exmaple with this wont work (package-info.java):
@FilterDef(name = "deletedFilter", defaultCondition = "deleted_at IS NULL")
package hu.webdream.iunox.model;
import org.hibernate.annotations.FilterDef;
When I run from maven the liquibase:diff command it fails with this error:
[ERROR] Error setting up or running Liquibase:
[ERROR] org.hibernate.AnnotationException: Entity 'Group' has a '@Filter' for an undefined filter named 'deletedFilter'
However it works fine in my Spring application.
I work with spring-boot, and have no persistence.xml file, I configured a TypeDef in file package-info.java, I set hibernate.hmb2ddl.auto to create, run the test case, the type in the database will surely be datetime, but it doesn't work with liquibase-hibernate spring connection. here is my configuraion in the pom.xml.
here is the codes in my package-info.java
┆Issue is synchronized with this Jira Bug by Unito