[Hibernate-JIRA] Created: (HHH-6482) ddl from schema export is not correctly formatted
by Strong Liu (JIRA)
ddl from schema export is not correctly formatted
--------------------------------------------------
Key: HHH-6482
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6482
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 4.0.0.Beta4
Reporter: Strong Liu
Assignee: Strong Liu
Fix For: 4.0.0.next
if we have *hibernate.format_sql true* and also *org.hibernate.SQL debug*, the ddl output will like this
{quote}
Hibernate:
create table Bar ( details varchar(255), BAR_ID bigint not null, primary key (BAR_ID), unique (BAR_ID) )
{quote}
but we want it this
{quote}
Hibernate:
create table hibernate_sequences (
sequence_name varchar(255) not null ,
next_val bigint,
primary key ( sequence_name )
)
{quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (HHH-6481) Using native sql with entity (addEntity), which has formula property causes NPE
by Tomáš Šafařík (JIRA)
Using native sql with entity (addEntity), which has formula property causes NPE
-------------------------------------------------------------------------------
Key: HHH-6481
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6481
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 4.0.0.Beta1, 3.6.5
Reporter: Tomáš Šafařík
Attachments: formula-test.zip
I've discovered that using native sql with entity (addEntity), which has formula property, causes this exception:
-------------------------------------------------------------------------------
Test set: org.hibernate.test.formula.FormulaWithNativeSqlTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.991 sec <<< FAILURE!
testBasicUsage(org.hibernate.test.formula.FormulaWithNativeSqlTest) Time elapsed: 0.966 sec <<< ERROR!
java.lang.NullPointerException
at org.hibernate.loader.DefaultEntityAliases.intern(DefaultEntityAliases.java:192)
at org.hibernate.loader.DefaultEntityAliases.getSuffixedPropertyAliases(DefaultEntityAliases.java:150)
at org.hibernate.loader.DefaultEntityAliases.determinePropertyAliases(DefaultEntityAliases.java:92)
at org.hibernate.loader.DefaultEntityAliases.<init>(DefaultEntityAliases.java:64)
at org.hibernate.loader.ColumnEntityAliases.<init>(ColumnEntityAliases.java:42)
at org.hibernate.loader.custom.sql.SQLQueryReturnProcessor.generateCustomReturns(SQLQueryReturnProcessor.java:196)
at org.hibernate.loader.custom.sql.SQLCustomQuery.<init>(SQLCustomQuery.java:151)
at org.hibernate.engine.query.spi.NativeSQLQueryPlan.<init>(NativeSQLQueryPlan.java:65)
at org.hibernate.engine.query.spi.QueryPlanCache.getNativeSQLQueryPlan(QueryPlanCache.java:156)
at org.hibernate.internal.AbstractSessionImpl.getNativeSQLQueryPlan(AbstractSessionImpl.java:218)
at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:224)
at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:156)
at org.hibernate.test.formula.FormulaWithNativeSqlTest.testBasicUsage(FormulaWithNativeSqlTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
This failure is related to HHH-2536 and HHH-2225 that should be fixed in versions 3.6.5 and 4.0.0.Beta1.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (METAGEN-71) Metamodel check fails when subclasses are used
by kk (JIRA)
Metamodel check fails when subclasses are used
----------------------------------------------
Key: METAGEN-71
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-71
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.1.1.Final
Reporter: kk
Assignee: Hardy Ferentschik
Situation:
Class 'AbstractIntake' which has the field 'm_startDate'
Class 'Intake' extends 'AbstractIntake'
In Class 'AbstractIntake_.java" there is the line:
public static volatile SingularAttribute<WorkOrder, MESDateField> m_startDate;
'm_startDate' is of type MESDateField which is an Embeddable object.
Result:
I get the following error when the metamodel is checked:
Unable to locate static metamodel field : gti.domain.Intake_#m_startDate
Expected:
'Intake_' subclasses 'AbstractIntake_' and therefore has access to the
static variable 'm_startDate' (in AbstractIntake_). The errormessage is
therefore not valid!
Hints:
MESDateField is an Embeddable object.
It seems to only to go wrong with Embeddable objects.
Maybe the problem is in "MetadataContext.registerAttribute()'.
There ONLY the getDeclaredField(name) of the class is checked but NOT the
subclasses of that class!
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months