Hi,

I'm trying to create an "IdEntityBean" superclass:

package test.ejb.entity;

import java.util.*;
import javax.persistence.*;

@MappedSuperclass
public abstract class IdEntityBean {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO, generator = "Seq")
  Integer id;
  public Integer getId() { return id;}
}


I can extend another class from this one:

package test.ejb.entity;

import java.util.*;
import javax.persistence.*;
import javax.ejb.*;

@Entity
@Remote
@Inheritance
@Table(name="a")

@NamedQuery(
  name="ABean.findAll",
  query="SELECT o FROM ABean o ORDER BY o.m_sInfo DESC"
)

public class ABean extends IdEntityBean {
  @SequenceGenerator(name = "AlfaSeq", sequenceName = "Seq")

  @Column(name="info")
  String m_sInfo;
  
  @PrePersist
  public void setCreateInfo() {
    m_sInfo = "";
  }

  public String getInfo() { return m_sInfo;}
  public void setInfo(String info) { m_sInfo = info;}
}

but when I deploy I obtain this error:

2006-03-07 11:00:11,624 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRe
pository, [EMAIL PROTECTED],
[EMAIL PROTECTED] url=null ,addedOrder=0}
2006-03-07 11:00:11,624 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing an
notations of test.ejb.entity.ABean.id
2006-03-07 11:00:11,624 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column id u
nique false
2006-03-07 11:00:11,624 DEBUG [org.hibernate.cfg.AnnotationBinder] id is an id
2006-03-07 11:00:11,624 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder]
building SimpleValue for id
2006-03-07 11:00:11,624 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting f
ailed persistence.units:ear=test.ear.ear,jar=test-ear.jar.jar,unitName=TestPersi
stenceManager
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)


......

Caused by: org.hibernate.AnnotationException: Unknown Id.generator: Seq
        at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1595)
        at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(Annotati
onBinder.java:1065)
        at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:62
9)



Any idea?
TIA
Roberto Colmegna

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928412#3928412

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3928412


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to