[jbosstools-issues] [JBoss JIRA] (JBIDE-12179) Invalid Error marker when using Hibernate @Type annotation

Denis Golovin (JIRA) jira-events at lists.jboss.org
Tue Aug 14 18:49:14 EDT 2012


    [ https://issues.jboss.org/browse/JBIDE-12179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711589#comment-12711589 ] 

Denis Golovin commented on JBIDE-12179:
---------------------------------------

Should be possible, here is the patch
{code}
Index: src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java
===================================================================
--- src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java	(revision 43033)
+++ src/org/jboss/tools/hibernate/jpt/core/internal/context/java/TypeImpl.java	(working copy)
@@ -25,6 +25,7 @@
 import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
 import org.eclipse.wst.validation.internal.provisional.core.IMessage;
 import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.hibernate.type.TypeFactory;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
 import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
 import org.jboss.tools.hibernate.jpt.core.internal.resource.java.TypeAnnotation;
@@ -140,7 +141,7 @@
 				messages.add(HibernateJpaValidationMessage.buildMessage(
 						IMessage.HIGH_SEVERITY,
 						TYPE_CANT_BE_EMPTY, this, range));
-			} else if (!getPersistenceUnit().hasTypeDef(type))	{
+			} else if (TypeFactory.basic(type) == null && !getPersistenceUnit().hasTypeDef(type))	{
 				IType lwType = null;
 				try {
 					lwType = getJpaProject().getJavaProject().findType(type);
{code}
                
> Invalid Error marker when using Hibernate @Type annotation
> ----------------------------------------------------------
>
>                 Key: JBIDE-12179
>                 URL: https://issues.jboss.org/browse/JBIDE-12179
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: hibernate
>    Affects Versions: 3.3.0.CR1
>            Reporter: Corey Puffalt
>            Assignee: Denis Golovin
>             Fix For: 3.3.2, 3.4.0.M1
>
>
> We're seeing invalid error markers when using the Hibernate @Type annotation where the type value we're specifying isn't actually a Class name.  This looks like a bug in JBoss Tools (I have the new Candidate Release installed).
>  
> Sample class:
> {code}
> import javax.persistence.Entity;
> import javax.persistence.Id;
>  
> import org.hibernate.annotations.Type;
>  
> @Entity
> public class TestEntity
> {
>   @Id
>   private Long id;
>  
>   @Type(type = "yes_no")
>   private Boolean flag;
> }
> {code}
> The error marker states 'Type class "yes_no" could not be found.' but this is actually valid.
>  
> I did find some similar cases (JBIDE-11364, JBIDE-11368) in the bug tracker but not one that described this issue exactly.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the jbosstools-issues mailing list