Hibernate SVN: r15933 - core/branches/Branch_3_2/doc/reference/en/modules.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 16:45:05 -0500 (Tue, 10 Feb 2009)
New Revision: 15933
Modified:
core/branches/Branch_3_2/doc/reference/en/modules/persistent_classes.xml
Log:
HHH-3760 : document EntityNameResolver
Modified: core/branches/Branch_3_2/doc/reference/en/modules/persistent_classes.xml
===================================================================
--- core/branches/Branch_3_2/doc/reference/en/modules/persistent_classes.xml 2009-02-10 21:44:48 UTC (rev 15932)
+++ core/branches/Branch_3_2/doc/reference/en/modules/persistent_classes.xml 2009-02-10 21:45:05 UTC (rev 15933)
@@ -1,3 +1,5 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+
<chapter id="persistent-classes" revision="2">
<title>Persistent Classes</title>
@@ -523,6 +525,153 @@
</sect1>
+ <sect1 id="persistent-classes-entity-name-resolver" revision="0">
+ <title>EntityNameResolvers</title>
+
+ <para>
+ The <interfacename>org.hibernate.EntityNameResolver</interfacename> interface is a contract for resolving the
+ entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname>
+ which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and
+ would indicate that the resolver does not know how to resolve the entity name of the given entity instance).
+ Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most
+ useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The
+ hibernate test suite has an example of this exact style of usage under the
+ <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package
+ for illustration.
+ </para>
+
+ <programlisting>
+/**
+ * A very trivial JDK Proxy InvocationHandler implementation where we proxy an interface as
+ * the domain model and simply store persistent state in an internal Map. This is an extremely
+ * trivial example meant only for illustration.
+ */
+public final class DataProxyHandler implements InvocationHandler {
+ private String entityName;
+ private HashMap data = new HashMap();
+
+ public DataProxyHandler(String entityName, Serializable id) {
+ this.entityName = entityName;
+ data.put( "Id", id );
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String methodName = method.getName();
+ if ( methodName.startsWith( "set" ) ) {
+ String propertyName = methodName.substring( 3 );
+ data.put( propertyName, args[0] );
+ }
+ else if ( methodName.startsWith( "get" ) ) {
+ String propertyName = methodName.substring( 3 );
+ return data.get( propertyName );
+ }
+ else if ( "toString".equals( methodName ) ) {
+ return entityName + "#" + data.get( "Id" );
+ }
+ else if ( "hashCode".equals( methodName ) ) {
+ return new Integer( this.hashCode() );
+ }
+ return null;
+ }
+
+ public String getEntityName() {
+ return entityName;
+ }
+
+ public HashMap getData() {
+ return data;
+ }
+}
+
+/**
+ *
+ */
+public class ProxyHelper {
+ public static String extractEntityName(Object object) {
+ // Our custom java.lang.reflect.Proxy instances actually bundle
+ // their appropriate entity name, so we simply extract it from there
+ // if this represents one of our proxies; otherwise, we return null
+ if ( Proxy.isProxyClass( object.getClass() ) ) {
+ InvocationHandler handler = Proxy.getInvocationHandler( object );
+ if ( DataProxyHandler.class.isAssignableFrom( handler.getClass() ) ) {
+ DataProxyHandler myHandler = ( DataProxyHandler ) handler;
+ return myHandler.getEntityName();
+ }
+ }
+ return null;
+ }
+
+ // various other utility methods ....
+
+}
+
+/**
+ * The EntityNameResolver implementation.
+ * IMPL NOTE : An EntityNameResolver really defines a strategy for how entity names should be
+ * resolved. Since this particular impl can handle resolution for all of our entities we want to
+ * take advantage of the fact that SessionFactoryImpl keeps these in a Set so that we only ever
+ * have one instance registered. Why? Well, when it comes time to resolve an entity name,
+ * Hibernate must iterate over all the registered resolvers. So keeping that number down
+ * helps that process be as speedy as possible. Hence the equals and hashCode impls
+ */
+public class MyEntityNameResolver implements EntityNameResolver {
+ public static final MyEntityNameResolver INSTANCE = new MyEntityNameResolver();
+
+ public String resolveEntityName(Object entity) {
+ return ProxyHelper.extractEntityName( entity );
+ }
+
+ public boolean equals(Object obj) {
+ return getClass().equals( obj.getClass() );
+ }
+
+ public int hashCode() {
+ return getClass().hashCode();
+ }
+}
+
+public class MyEntityTuplizer extends PojoEntityTuplizer {
+ public MyEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
+ super( entityMetamodel, mappedEntity );
+ }
+
+ public EntityNameResolver[] getEntityNameResolvers() {
+ return new EntityNameResolver[] { MyEntityNameResolver.INSTANCE };
+ }
+
+ public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {
+ String entityName = ProxyHelper.extractEntityName( entityInstance );
+ if ( entityName == null ) {
+ entityName = super.determineConcreteSubclassEntityName( entityInstance, factory );
+ }
+ return entityName;
+ }
+
+ ...
+}
+ </programlisting>
+
+ <para>
+ In order to register an <interfacename>org.hibernate.EntityNameResolver</interfacename> users must either:
+ <orderedlist>
+ <listitem>
+ <para>
+ Implement a custom <link linkend="persistent-classes-tuplizers">Tuplizer</link>, implementing
+ the <methodname>getEntityNameResolvers</methodname> method.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</classname> (which is the
+ implementation class for <interfacename>org.hibernate.SessionFactory</interfacename>) using the
+ <methodname>registerEntityNameResolver</methodname> method.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect1>
+
+
<para>
TODO: Document user-extension framework in the property and proxy packages
</para>
15 years, 3 months
Hibernate SVN: r15932 - core/trunk/documentation/manual/src/main/docbook/en-US/content.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 16:44:48 -0500 (Tue, 10 Feb 2009)
New Revision: 15932
Modified:
core/trunk/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml
Log:
HHH-3760 : document EntityNameResolver
Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml 2009-02-10 21:44:33 UTC (rev 15931)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml 2009-02-10 21:44:48 UTC (rev 15932)
@@ -551,11 +551,158 @@
return new CustomMap();
}
}
-}]]></programlisting>m
+}]]></programlisting>
</sect1>
+
+ <sect1 id="persistent-classes-entity-name-resolver" revision="0">
+ <title>EntityNameResolvers</title>
+
+ <para>
+ The <interfacename>org.hibernate.EntityNameResolver</interfacename> interface is a contract for resolving the
+ entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname>
+ which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and
+ would indicate that the resolver does not know how to resolve the entity name of the given entity instance).
+ Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most
+ useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The
+ hibernate test suite has an example of this exact style of usage under the
+ <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package
+ for illustration.
+ </para>
+
+ <programlisting>
+/**
+ * A very trivial JDK Proxy InvocationHandler implementation where we proxy an interface as
+ * the domain model and simply store persistent state in an internal Map. This is an extremely
+ * trivial example meant only for illustration.
+ */
+public final class DataProxyHandler implements InvocationHandler {
+ private String entityName;
+ private HashMap data = new HashMap();
+
+ public DataProxyHandler(String entityName, Serializable id) {
+ this.entityName = entityName;
+ data.put( "Id", id );
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String methodName = method.getName();
+ if ( methodName.startsWith( "set" ) ) {
+ String propertyName = methodName.substring( 3 );
+ data.put( propertyName, args[0] );
+ }
+ else if ( methodName.startsWith( "get" ) ) {
+ String propertyName = methodName.substring( 3 );
+ return data.get( propertyName );
+ }
+ else if ( "toString".equals( methodName ) ) {
+ return entityName + "#" + data.get( "Id" );
+ }
+ else if ( "hashCode".equals( methodName ) ) {
+ return new Integer( this.hashCode() );
+ }
+ return null;
+ }
+
+ public String getEntityName() {
+ return entityName;
+ }
+
+ public HashMap getData() {
+ return data;
+ }
+}
+
+/**
+ *
+ */
+public class ProxyHelper {
+ public static String extractEntityName(Object object) {
+ // Our custom java.lang.reflect.Proxy instances actually bundle
+ // their appropriate entity name, so we simply extract it from there
+ // if this represents one of our proxies; otherwise, we return null
+ if ( Proxy.isProxyClass( object.getClass() ) ) {
+ InvocationHandler handler = Proxy.getInvocationHandler( object );
+ if ( DataProxyHandler.class.isAssignableFrom( handler.getClass() ) ) {
+ DataProxyHandler myHandler = ( DataProxyHandler ) handler;
+ return myHandler.getEntityName();
+ }
+ }
+ return null;
+ }
+
+ // various other utility methods ....
+
+}
+
+/**
+ * The EntityNameResolver implementation.
+ * IMPL NOTE : An EntityNameResolver really defines a strategy for how entity names should be
+ * resolved. Since this particular impl can handle resolution for all of our entities we want to
+ * take advantage of the fact that SessionFactoryImpl keeps these in a Set so that we only ever
+ * have one instance registered. Why? Well, when it comes time to resolve an entity name,
+ * Hibernate must iterate over all the registered resolvers. So keeping that number down
+ * helps that process be as speedy as possible. Hence the equals and hashCode impls
+ */
+public class MyEntityNameResolver implements EntityNameResolver {
+ public static final MyEntityNameResolver INSTANCE = new MyEntityNameResolver();
+
+ public String resolveEntityName(Object entity) {
+ return ProxyHelper.extractEntityName( entity );
+ }
+
+ public boolean equals(Object obj) {
+ return getClass().equals( obj.getClass() );
+ }
+
+ public int hashCode() {
+ return getClass().hashCode();
+ }
+}
+
+public class MyEntityTuplizer extends PojoEntityTuplizer {
+ public MyEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
+ super( entityMetamodel, mappedEntity );
+ }
+
+ public EntityNameResolver[] getEntityNameResolvers() {
+ return new EntityNameResolver[] { MyEntityNameResolver.INSTANCE };
+ }
+
+ public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {
+ String entityName = ProxyHelper.extractEntityName( entityInstance );
+ if ( entityName == null ) {
+ entityName = super.determineConcreteSubclassEntityName( entityInstance, factory );
+ }
+ return entityName;
+ }
+
+ ...
+}
+ </programlisting>
+
+ <para>
+ In order to register an <interfacename>org.hibernate.EntityNameResolver</interfacename> users must either:
+ <orderedlist>
+ <listitem>
+ <para>
+ Implement a custom <link linkend="persistent-classes-tuplizers">Tuplizer</link>, implementing
+ the <methodname>getEntityNameResolvers</methodname> method.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</classname> (which is the
+ implementation class for <interfacename>org.hibernate.SessionFactory</interfacename>) using the
+ <methodname>registerEntityNameResolver</methodname> method.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect1>
+
<!--<sect1 id="persistent-classes-extensions">
<title>Extensions</title>
<para>
15 years, 3 months
Hibernate SVN: r15931 - core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 16:44:33 -0500 (Tue, 10 Feb 2009)
New Revision: 15931
Modified:
core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml
Log:
HHH-3760 : document EntityNameResolver
Modified: core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml
===================================================================
--- core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml 2009-02-10 18:38:46 UTC (rev 15930)
+++ core/branches/Branch_3_3/documentation/manual/src/main/docbook/en-US/content/persistent_classes.xml 2009-02-10 21:44:33 UTC (rev 15931)
@@ -551,11 +551,157 @@
return new CustomMap();
}
}
-}]]></programlisting>m
+}]]></programlisting>
</sect1>
+ <sect1 id="persistent-classes-entity-name-resolver" revision="0">
+ <title>EntityNameResolvers</title>
+
+ <para>
+ The <interfacename>org.hibernate.EntityNameResolver</interfacename> interface is a contract for resolving the
+ entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname>
+ which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and
+ would indicate that the resolver does not know how to resolve the entity name of the given entity instance).
+ Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most
+ useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The
+ hibernate test suite has an example of this exact style of usage under the
+ <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package
+ for illustration.
+ </para>
+
+ <programlisting>
+/**
+ * A very trivial JDK Proxy InvocationHandler implementation where we proxy an interface as
+ * the domain model and simply store persistent state in an internal Map. This is an extremely
+ * trivial example meant only for illustration.
+ */
+public final class DataProxyHandler implements InvocationHandler {
+ private String entityName;
+ private HashMap data = new HashMap();
+
+ public DataProxyHandler(String entityName, Serializable id) {
+ this.entityName = entityName;
+ data.put( "Id", id );
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String methodName = method.getName();
+ if ( methodName.startsWith( "set" ) ) {
+ String propertyName = methodName.substring( 3 );
+ data.put( propertyName, args[0] );
+ }
+ else if ( methodName.startsWith( "get" ) ) {
+ String propertyName = methodName.substring( 3 );
+ return data.get( propertyName );
+ }
+ else if ( "toString".equals( methodName ) ) {
+ return entityName + "#" + data.get( "Id" );
+ }
+ else if ( "hashCode".equals( methodName ) ) {
+ return new Integer( this.hashCode() );
+ }
+ return null;
+ }
+
+ public String getEntityName() {
+ return entityName;
+ }
+
+ public HashMap getData() {
+ return data;
+ }
+}
+
+/**
+ *
+ */
+public class ProxyHelper {
+ public static String extractEntityName(Object object) {
+ // Our custom java.lang.reflect.Proxy instances actually bundle
+ // their appropriate entity name, so we simply extract it from there
+ // if this represents one of our proxies; otherwise, we return null
+ if ( Proxy.isProxyClass( object.getClass() ) ) {
+ InvocationHandler handler = Proxy.getInvocationHandler( object );
+ if ( DataProxyHandler.class.isAssignableFrom( handler.getClass() ) ) {
+ DataProxyHandler myHandler = ( DataProxyHandler ) handler;
+ return myHandler.getEntityName();
+ }
+ }
+ return null;
+ }
+
+ // various other utility methods ....
+
+}
+
+/**
+ * The EntityNameResolver implementation.
+ * IMPL NOTE : An EntityNameResolver really defines a strategy for how entity names should be
+ * resolved. Since this particular impl can handle resolution for all of our entities we want to
+ * take advantage of the fact that SessionFactoryImpl keeps these in a Set so that we only ever
+ * have one instance registered. Why? Well, when it comes time to resolve an entity name,
+ * Hibernate must iterate over all the registered resolvers. So keeping that number down
+ * helps that process be as speedy as possible. Hence the equals and hashCode impls
+ */
+public class MyEntityNameResolver implements EntityNameResolver {
+ public static final MyEntityNameResolver INSTANCE = new MyEntityNameResolver();
+
+ public String resolveEntityName(Object entity) {
+ return ProxyHelper.extractEntityName( entity );
+ }
+
+ public boolean equals(Object obj) {
+ return getClass().equals( obj.getClass() );
+ }
+
+ public int hashCode() {
+ return getClass().hashCode();
+ }
+}
+
+public class MyEntityTuplizer extends PojoEntityTuplizer {
+ public MyEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) {
+ super( entityMetamodel, mappedEntity );
+ }
+
+ public EntityNameResolver[] getEntityNameResolvers() {
+ return new EntityNameResolver[] { MyEntityNameResolver.INSTANCE };
+ }
+
+ public String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory) {
+ String entityName = ProxyHelper.extractEntityName( entityInstance );
+ if ( entityName == null ) {
+ entityName = super.determineConcreteSubclassEntityName( entityInstance, factory );
+ }
+ return entityName;
+ }
+
+ ...
+}
+ </programlisting>
+
+ <para>
+ In order to register an <interfacename>org.hibernate.EntityNameResolver</interfacename> users must either:
+ <orderedlist>
+ <listitem>
+ <para>
+ Implement a custom <link linkend="persistent-classes-tuplizers">Tuplizer</link>, implementing
+ the <methodname>getEntityNameResolvers</methodname> method.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</classname> (which is the
+ implementation class for <interfacename>org.hibernate.SessionFactory</interfacename>) using the
+ <methodname>registerEntityNameResolver</methodname> method.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ </sect1>
+
<!--<sect1 id="persistent-classes-extensions">
<title>Extensions</title>
<para>
15 years, 3 months
Hibernate SVN: r15930 - in validator/trunk/hibernate-validator: src/test/java/org/hibernate/validation/engine and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-02-10 13:38:46 -0500 (Tue, 10 Feb 2009)
New Revision: 15930
Modified:
validator/trunk/hibernate-validator/pom.xml
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/ReflectionHelperTest.java
Log:
removed dependency to tck-utils
Modified: validator/trunk/hibernate-validator/pom.xml
===================================================================
--- validator/trunk/hibernate-validator/pom.xml 2009-02-10 17:36:47 UTC (rev 15929)
+++ validator/trunk/hibernate-validator/pom.xml 2009-02-10 18:38:46 UTC (rev 15930)
@@ -38,12 +38,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>tck-utils</artifactId>
- <version>0.9-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
<resources>
@@ -146,40 +140,4 @@
</plugin>
</plugins>
</reporting>
- <profiles>
- <profile>
- <id>tck-audit</id>
- <activation>
- <jdk>1.6</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <compilerArgument>-proc:none</compilerArgument>
- </configuration>
- <executions>
- <execution>
- <id>run-annotation-processor-only</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal> testCompile</goal>
- </goals>
- <configuration>
- <compilerArgument>-proc:only</compilerArgument>
- <compilerArguments>
- <processor>org.hibernate.tck.report.CoverageProcessor</processor>
- </compilerArguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2009-02-10 17:36:47 UTC (rev 15929)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2009-02-10 18:38:46 UTC (rev 15930)
@@ -29,7 +29,6 @@
import static org.junit.Assert.fail;
import org.junit.Test;
-import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.validation.eg.Actor;
import org.hibernate.validation.eg.Address;
import org.hibernate.validation.eg.Animal;
@@ -55,7 +54,7 @@
*/
public class ValidatorImplTest {
- @SpecAssertion( section = "3.1" )
+ // @SpecAssertion( section = "3.1" )
@Test
public void testWrongMethodName() {
try {
@@ -324,7 +323,7 @@
}
@Test
- @SpecAssertion( section = "2.2" )
+ // @SpecAssertion( section = "2.2" )
public void testMultiValueConstraint() {
Validator validator = TestUtil.getValidator();
@@ -343,7 +342,7 @@
}
@Test
- @SpecAssertion( section = "3.5.1" )
+ // @SpecAssertion( section = "3.5.1" )
public void testGraphValidation() {
Validator validator = TestUtil.getValidator();
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/ReflectionHelperTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/ReflectionHelperTest.java 2009-02-10 17:36:47 UTC (rev 15929)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/ReflectionHelperTest.java 2009-02-10 18:38:46 UTC (rev 15930)
@@ -24,8 +24,8 @@
import java.util.List;
import java.util.Map;
import javax.validation.ValidationException;
-import javax.validation.groups.Default;
import javax.validation.constraints.NotNull;
+import javax.validation.groups.Default;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -39,10 +39,9 @@
import org.hibernate.validation.constraints.Patterns;
import org.hibernate.validation.constraints.incomplete.NoGroups;
import org.hibernate.validation.constraints.incomplete.NoMessage;
+import org.hibernate.validation.constraints.incomplete.ValidProperty;
import org.hibernate.validation.eg.Engine;
import org.hibernate.validation.eg.Order;
-import org.hibernate.validation.constraints.incomplete.ValidProperty;
-import org.hibernate.tck.annotations.SpecAssertion;
/**
* Tests for the <code>ReflectionHelper</code>.
@@ -132,7 +131,7 @@
}
@Test
- @SpecAssertion(section = "2.1.1.2", note = "constraint annotation must specify a groups element")
+ // @SpecAssertion(section = "2.1.1.2", note = "constraint annotation must specify a groups element")
public void testConstraintWithNoMessage() {
Annotation annotation = new NoGroups() {
public String message() {
@@ -149,7 +148,7 @@
}
@Test
- @SpecAssertion(section = "2.1.1.1", note = "constraint annotation must specify a groups element")
+ // @SpecAssertion(section = "2.1.1.1", note = "constraint annotation must specify a groups element")
public void testConstraintWithNoGroups() {
Annotation annotation = new NoMessage() {
public Class<?>[] groups() {
@@ -166,7 +165,7 @@
}
@Test
- @SpecAssertion(section = "2.1.1", note = "properties cannot begin with 'valid'")
+ // @SpecAssertion(section = "2.1.1", note = "properties cannot begin with 'valid'")
public void testConstraintWithValidInPropertyName() {
Annotation annotation = new ValidProperty() {
public String message() {
15 years, 3 months
Hibernate SVN: r15929 - core/branches/Branch_3_2/src/org/hibernate/id/enhanced.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 12:36:47 -0500 (Tue, 10 Feb 2009)
New Revision: 15929
Modified:
core/branches/Branch_3_2/src/org/hibernate/id/enhanced/TableGenerator.java
Log:
HHH-3650 : PK column from TableGenerator needs explicit not null for silly DBs
Modified: core/branches/Branch_3_2/src/org/hibernate/id/enhanced/TableGenerator.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/id/enhanced/TableGenerator.java 2009-02-10 17:32:18 UTC (rev 15928)
+++ core/branches/Branch_3_2/src/org/hibernate/id/enhanced/TableGenerator.java 2009-02-10 17:36:47 UTC (rev 15929)
@@ -493,7 +493,7 @@
.append( segmentColumnName )
.append( ' ' )
.append( dialect.getTypeName( Types.VARCHAR, segmentValueLength, 0, 0 ) )
- .append( ", " )
+ .append( " not null, " )
.append( valueColumnName )
.append( ' ' )
.append( dialect.getTypeName( Types.BIGINT ) )
15 years, 3 months
Hibernate SVN: r15928 - core/branches/Branch_3_2/src/org/hibernate.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 12:32:18 -0500 (Tue, 10 Feb 2009)
New Revision: 15928
Modified:
core/branches/Branch_3_2/src/org/hibernate/hibernate-mapping-3.0.dtd
Log:
HHH-3275 : custom tuplizers for components in a collection
Modified: core/branches/Branch_3_2/src/org/hibernate/hibernate-mapping-3.0.dtd
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/hibernate-mapping-3.0.dtd 2009-02-10 17:32:00 UTC (rev 15927)
+++ core/branches/Branch_3_2/src/org/hibernate/hibernate-mapping-3.0.dtd 2009-02-10 17:32:18 UTC (rev 15928)
@@ -776,6 +776,7 @@
<!ELEMENT composite-element (
(meta*),
parent?,
+ tuplizer*,
(property|many-to-one|any|nested-composite-element)*
)>
<!ATTLIST composite-element class CDATA #REQUIRED>
@@ -783,6 +784,7 @@
<!ELEMENT nested-composite-element (
parent?,
+ tuplizer*,
(property|many-to-one|any|nested-composite-element)*
)>
<!ATTLIST nested-composite-element class CDATA #REQUIRED>
15 years, 3 months
Hibernate SVN: r15927 - core/branches/Branch_3_3/core/src/main/resources/org/hibernate.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 12:32:00 -0500 (Tue, 10 Feb 2009)
New Revision: 15927
Modified:
core/branches/Branch_3_3/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd
Log:
HHH-3275 : custom tuplizers for components in a collection
Modified: core/branches/Branch_3_3/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd
===================================================================
--- core/branches/Branch_3_3/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd 2009-02-10 17:28:47 UTC (rev 15926)
+++ core/branches/Branch_3_3/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd 2009-02-10 17:32:00 UTC (rev 15927)
@@ -776,6 +776,7 @@
<!ELEMENT composite-element (
(meta*),
parent?,
+ tuplizer*,
(property|many-to-one|any|nested-composite-element)*
)>
<!ATTLIST composite-element class CDATA #REQUIRED>
@@ -783,6 +784,7 @@
<!ELEMENT nested-composite-element (
parent?,
+ tuplizer*,
(property|many-to-one|any|nested-composite-element)*
)>
<!ATTLIST nested-composite-element class CDATA #REQUIRED>
15 years, 3 months
Hibernate SVN: r15926 - core/trunk/core/src/main/resources/org/hibernate.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-02-10 12:28:47 -0500 (Tue, 10 Feb 2009)
New Revision: 15926
Modified:
core/trunk/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd
Log:
HHH-3275 : custom tuplizers for components in a collection
Modified: core/trunk/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd
===================================================================
--- core/trunk/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd 2009-02-10 16:55:10 UTC (rev 15925)
+++ core/trunk/core/src/main/resources/org/hibernate/hibernate-mapping-3.0.dtd 2009-02-10 17:28:47 UTC (rev 15926)
@@ -806,6 +806,7 @@
<!ELEMENT composite-element (
(meta*),
parent?,
+ tuplizer*,
(property|many-to-one|any|nested-composite-element)*
)>
<!ATTLIST composite-element class CDATA #REQUIRED>
@@ -813,6 +814,7 @@
<!ELEMENT nested-composite-element (
parent?,
+ tuplizer*,
(property|many-to-one|any|nested-composite-element)*
)>
<!ATTLIST nested-composite-element class CDATA #REQUIRED>
15 years, 3 months
Hibernate SVN: r15925 - validator/trunk/validation-api/src/main/java/javax/validation/groups.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-02-10 11:55:10 -0500 (Tue, 10 Feb 2009)
New Revision: 15925
Modified:
validator/trunk/validation-api/src/main/java/javax/validation/groups/Default.java
Log:
minor JavaDoc improvement
Modified: validator/trunk/validation-api/src/main/java/javax/validation/groups/Default.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/groups/Default.java 2009-02-10 15:38:30 UTC (rev 15924)
+++ validator/trunk/validation-api/src/main/java/javax/validation/groups/Default.java 2009-02-10 16:55:10 UTC (rev 15925)
@@ -4,7 +4,6 @@
* Default Bean Validation group
*
* @author Emmanuel Bernard
- * TODO should it be named DefaultGroup?
*/
public interface Default {
}
15 years, 3 months
Hibernate SVN: r15924 - in validator/trunk/hibernate-validator/src/main: docbook/en-US and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-02-10 10:38:30 -0500 (Tue, 10 Feb 2009)
New Revision: 15924
Modified:
validator/trunk/hibernate-validator/src/main/assembly/dist.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml
Log:
for the alpha release we will only include the getting started section
Modified: validator/trunk/hibernate-validator/src/main/assembly/dist.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/assembly/dist.xml 2009-02-10 15:16:11 UTC (rev 15923)
+++ validator/trunk/hibernate-validator/src/main/assembly/dist.xml 2009-02-10 15:38:30 UTC (rev 15924)
@@ -56,6 +56,7 @@
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<exclude>**/target/**</exclude>
+ <exclude>*.iml</exclude>
</excludes>
</fileSet>
</fileSets>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml 2009-02-10 15:16:11 UTC (rev 15923)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml 2009-02-10 15:38:30 UTC (rev 15924)
@@ -37,7 +37,7 @@
<issuenum>1</issuenum>
<mediaobject>
<imageobject>
- <imagedata fileref="images/hibernate_logo_a.png" format="png" />
+ <imagedata fileref="hibernate_logo_a.png" format="png" />
</imageobject>
</mediaobject>
<copyright>
@@ -87,13 +87,16 @@
<classname>ResourceBundle</classname> .</para>
</preface>
- <xi:include href="modules/introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- For the alpha release we will just include the getting started section, since the others are work in progress -->
+ <!--xi:include href="modules/introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /-->
<xi:include href="modules/gettingstarted.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<!--
<xi:include href="modules/usingvalidator.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/customconstraints.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/xmlconfiguration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/integration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/extendedri.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+-->
<!--
<xi:include href="modules/defineconstraints.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
15 years, 3 months