Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
.../org/hibernate/test/schemavalidation/matchingtablenames/TableNamesWithUnderscoreTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.test.schemavalidation.matchingtablenames; | ||
|
||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
import org.hibernate.tool.hbm2ddl.SchemaValidator; | ||
|
||
import org.junit.Test; | ||
|
||
import org.hibernate.testing.TestForIssue; | ||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; | ||
|
||
/** | ||
* @author Andrea Boriero | ||
*/ | ||
@TestForIssue(jiraKey = "HHH-10718") | ||
public class TableNamesWithUnderscoreTest extends BaseNonConfigCoreFunctionalTestCase { | ||
@Override | ||
protected Class<?>[] getAnnotatedClasses() { | ||
return new Class[] { | ||
Entity1.class, | ||
Entity01.class | ||
}; | ||
} | ||
|
||
@Test | ||
public void testSchemaValidationDoesNotFailDueToAMoreThanOneTableFound() { | ||
new SchemaValidator().validate( metadata() ); | ||
} | ||
|
||
@Entity(name = "Entity1") | ||
@Table(name = "Entity_1") | ||
public static class Entity1 { | ||
@Id | ||
@GeneratedValue | ||
private int id; | ||
} | ||
|
||
@Entity(name = "Entity01") | ||
@Table(name = "Entity01") | ||
public static class Entity01 { | ||
@Id | ||
@GeneratedValue | ||
private int id; | ||
} | ||
} |