[Hibernate-JIRA] Updated: (ANN-28) @Any
by Alexander Portnov (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-28?page=all ]
Alexander Portnov updated ANN-28:
---------------------------------
Attachment: annotations-any-patch2.txt
Added @MetaData annotation to avoid duplicate @MetaValue mappings on every property of the same type. @MetaData allows to specify mappings only once on the Interface itself. Also added metaDataClass attribute to @Any and @ManyToAny annotations. This is useful when property declaration uses generics.
For example:
public class PropertyList<T extends Property> {
private T someProperty;
...
@Any(idType="integer", metaType="string",
columns = {
@Column(name="property_type"),
@Column(name="property_id")},
metaDataClass = Property.class,
cascade= CascadeType.ALL)
public T getSomeProperty() {
return someProperty;
}
}
Where Property is mapped as following:
@MetaData({
@MetaValue(value="S", targetEntity=StringProperty.class),
@MetaValue(value="I", targetEntity=IntegerProperty.class)
})
public interface Property {
public String getName();
public String asString();
}
> @Any
> ----
>
> Key: ANN-28
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-28
> Project: Hibernate Annotations
> Type: Patch
> Components: binder
> Versions: 3.1beta3
> Reporter: Emmanuel Bernard
> Priority: Trivial
> Attachments: annotations-any-patch.txt, annotations-any-patch2.txt
>
>
> @AnyValue(value="", class="") //or MetaValue?
> @Any(idType="", metaType="", metaValues={@MetaValue()}, columns={@Column()})
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1921) "dirty, but no dirty properties" thrown when Interceptor resets properties.
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1921?page=c... ]
Steve Ebersole commented on HHH-1921:
-------------------------------------
Actually the real culprit here is DefaultMergeEventListener.entityIsTransient(). The save calls actually complete as anticipated *in terms of the managed copy state*, but the problem comes then from the after save cascading which writes the null component value from the original entity back into the managed copy, over-writing the work done by the interceptor during sve.
Just so I dont forget when I get a chance to get back to this ;)
> "dirty, but no dirty properties" thrown when Interceptor resets properties.
> ---------------------------------------------------------------------------
>
> Key: HHH-1921
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1921
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.2.0.cr2
> Environment: java version "1.5.0_07"
> Hibernate 3.2.cr2
> Reporter: Josh Moore
> Fix For: 3.2.1
> Attachments: InterceptorTest.java, ResetInterceptor.java, dirtybutnotdirty.zip
>
>
> When Interceptor.onfindDirty() resets properties to their DB value, the check in DefaultFlushEntityEventListener.scheduleUpdate:
> // if it was dirtied by a collection only
> int[] dirtyProperties = event.getDirtyProperties();
> if ( event.isDirtyCheckPossible() && dirtyProperties==null ) {
> if ( !event.hasDirtyCollection() ) {
> throw new AssertionFailure("dirty, but no dirty properties");
> }
> dirtyProperties = ArrayHelper.EMPTY_INT_ARRAY;
> }
> fails needlessly.
> Attached test has been confirmed against SVN TRUNK:
> URL: http://anonhibernate.labs.jboss.com/trunk/Hibernate3
> Revision: 10125
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Created: (HBX-813) Foreign key constraint names in reveng xml
by Eric Kershner (JIRA)
Foreign key constraint names in reveng xml
------------------------------------------
Key: HBX-813
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-813
Project: Hibernate Tools
Type: Improvement
Components: reverse-engineer
Versions: 3.2beta8
Environment: Hibernate 3.2GA, Oracle 10g
Reporter: Eric Kershner
The requirement for the constraint-name property in the foreign-key element may not be necessary. The OverrideBinder.bindForeignKeys method ignores the <foreign-key> directives silently if the constraint-name is not specified. However, the foreign key is already created by this time using Table.createForeignKey, which generates a constraint name using Table.uniqueColumnString. This should generate a unique constraint name since it is based on the referenced entity and the fk columns. This would eliminate the necessity to specify a constraint-name property, which can be inconvenient when mapping a lot of foreign keys which were not specified in the schema. Changes would include: changing the documentation to reflect the fact that the constraint-name is optional and would be generated if not specified; remove the StringHelper.isNotEmpty(constraintName) check in the OverrideBinder.bindForeignKeys. A check for duplicate foreign key constraint names already exists in the JDBCReader.processForeignKeys (where it throws an unchecked MappingException).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1528) GenericJDBCException when querying on one-to-one association
by Yajun Shi (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1528?page=c... ]
Yajun Shi commented on HHH-1528:
--------------------------------
Anyone has a solution to it yet?
> GenericJDBCException when querying on one-to-one association
> ------------------------------------------------------------
>
> Key: HHH-1528
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1528
> Project: Hibernate3
> Type: Bug
> Versions: 3.1.2
> Environment: Hibernate 3.1.2, MySQL 4.1, Java 5
> Reporter: Alexander Dvorkovyy
> Attachments: src.zip
>
>
> I am getting following stack trace:
> Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute query
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.doList(Loader.java:2148)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
> at org.hibernate.loader.Loader.list(Loader.java:2024)
> at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
> at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
> at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1129)
> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
> at BugDemo.main(BugDemo.java:28)
> 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:585)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: java.sql.SQLException: Statement parameter 1 not set.
> at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1031)
> at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:676)
> at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
> at org.hibernate.loader.Loader.doQuery(Loader.java:662)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
> at org.hibernate.loader.Loader.doList(Loader.java:2145)
> ... 13 more
> while executing this code:
> OneClass one = (OneClass) session.load(OneClass.class, 1L);
> Query query = session.createQuery("FROM OneToOneClass oto WHERE oto.whatever=:whatever");
> query.setParameter("whatever", one);
> query.list(); // < - - Exception is thrown here
> on this domain model (I used annotations here, same thing with hbm.xml):
> @Entity public class OneClass {
> @Id private Long id;
> }
> @Entity public class OneToOneClass {
> @Id private Long id;
> @OneToOne
> @PrimaryKeyJoinColumn
> private OneClass whatever;
> }
> Problem first appeared in 3.1 (also when using xml mapping files), in 3.0 no problem. Full source code attached.
> Would be nice if the problem can be fixed in upcoming 3.1.3
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months
[Hibernate-JIRA] Created: (HHH-2226) org.hibernate.hql.ast.tree.FromElementType contains warning log message that should be debug instead
by Don Smith (JIRA)
org.hibernate.hql.ast.tree.FromElementType contains warning log message that should be debug instead
----------------------------------------------------------------------------------------------------
Key: HHH-2226
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2226
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.2.0.ga
Environment: JBoss 4.0.5.GA, Hibernate 3.2.0.ga, Linux, MySQL Connector/J 5.0.4
Reporter: Don Smith
Priority: Minor
The org.hibernate.hql.ast.tree.FromElementType logs warnings about HQL statements it apparently doesn't like, similar to the one below:
16:01:36,406 WARN [FromElementType] Using non-qualified column reference [startTime -> ([STARTTIME])]
This warning comes from the following code (lines 347-351):
else {
String[] columns = propertyMapping.toColumns( path );
log.warn( "Using non-qualified column reference [" + path + " -> (" + ArrayHelper.toString( columns ) + ")]" );
return columns;
}
This message should be a debug level message, not warn. It seems impossible to get around it, whether aliases are used for the object & properties in the query or not.
Furthermore, could this message be removed completely, is it even valid?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
19 years, 5 months