-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: UserType problem - Could not determine type
PostPosted: Wed Oct 17, 2007 10:45 am 
Beginner
Beginner

Joined: Tue Mar 13, 2007 8:26 am
Posts: 25
Hello,

I'm getting this error when deploying my application in production server:

Quote:
org.hibernate.MappingException:
Could not determine type for: EntityStatusType, for columns: [org.hibernate.mapping.Column(STATUS)] javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: EntityStatusType, for columns: [org.hibernate.mapping.Column(STATUS)] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:737) at
(...)
Caused by: org.hibernate.MappingException: Could not determine type for: EntityStatusType, for columns: [org.hibernate.mapping.Column(STATUS)] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266) at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253) at


I've this custom type declared in one class (Estoque):

Code:
@TypeDef(name = "EntityStatusType",
    typeClass = visualcontrol.model.EntityStatusUserType.class,
    parameters = {
        @Parameter(name = "NORMAL", value = "S"),
        @Parameter(name = "CANCELADO", value = "C"),
        @Parameter(name = "nullConstant", value = "NORMAL")
})

@Entity
@Table(name = "ESTOQUE")
@SequenceGenerator(name = "SEQ_Estoque", sequenceName = "GEN_ESTOQUE",
    allocationSize = 1)
public class Estoque implements Serializable{
// ...
    @Column(name="STATUS")
    @Type(type="EntityStatusType")
    public EntityStatus getStatus() {
        return status;
    }

    public void setStatus(EntityStatus status) {
        this.status = status;
    } 


This custom type is used in other classes as well. The classes are: Estoque , Kardex and PedidoVenda

Kardex:
Code:
@Entity
@Table(name="KARDEX")
@SequenceGenerator(name = "SEQ_KARDEX", sequenceName = "GEN_KARDEX",
    allocationSize = 1)
public class Kardex implements Serializable{
// ...
    @Column(name="STATUS")
    @Type(type="EntityStatusType")
    public EntityStatus getStatus() {
        return status;
    }

    public void setStatus(EntityStatus status) {
        this.status = status;
    }


Running in the development server the application works fine. The only diference between the servers is, the development server is Windows Vista and the production server is Fedora 7.

What is wrong?

_________________
---
Felipe Marin Cypriano


Last edited by fmcypriano on Wed Oct 17, 2007 12:26 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 12:20 pm 
Beginner
Beginner

Joined: Tue Mar 13, 2007 8:26 am
Posts: 25
If I remove the mapping from Kardex and PedidoVenda, the error stop.

Code:
    //@Column(name="STATUS")
    //@Type(type="EntityStatusType")
    @Transient
    public EntityStatus getStatus() {
        return status;
    }

    public void setStatus(EntityStatus status) {
        this.status = status;
    }


So, seems that the TypeDef for EntityStatusType is only working for the class Estoque.

_________________
---
Felipe Marin Cypriano


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.