Skip to main content



      Home
Home » Eclipse Projects » Dali » "Unresolved generator name" if no class is not annotated with @Entity
"Unresolved generator name" if no class is not annotated with @Entity [message #434929] Mon, 14 July 2008 05:58 Go to next message
Eclipse UserFriend
Hi!
Here is an example class:

@MappedSuperclass
@Table(name="T_WEB_TEMP_APPL")
@SequenceGenerator(sequenceName="T_WEB_TEMP_APPL_SEQ", name = "appl_seq",
allocationSize = 1)
public class ApplicationBase implements Serializable {

@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "appl_seq")
private Long id;
...
}

"appl_seq" in @GeneratedValue annotation is marked with error: Unresolved
generator name "appl_seq". If @Entity annotation is added - error goes
away.
I'm pretty new to all that JPA stuff, so it's entirely possible that @Id
or @GeneratedValue are not allowed within @MappedSuperclass. Though I
haven't found any indication of that nor on the net neither in the books.

I'll be grateful for clarification on this issue.
Thanks very much!
Re: "Unresolved generator name" if no class is not annotated with @Entity [message #434930 is a reply to message #434929] Mon, 14 July 2008 09:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
SequenceGenerator is not supported on MappedSuperclasses, but if you just
move the SequenceGenerator annotation to the Id mapping that would work
fine, and as far as I know is perfectly valid. I agree that it's not
terribly clear, I often use the orm.xml schema to determine which
annotations belong with which mappings.

thanks,
Karen
Re: "Unresolved generator name" if no class is not annotated with @Entity [message #434939 is a reply to message #434930] Wed, 16 July 2008 18:27 Go to previous message
Eclipse UserFriend
Thanks, Karen. Really nice idea you shared about orm.xml... haven't
thought about it as a reference for using annotations :)
Re: "Unresolved generator name" if no class is not annotated with @Entity [message #610623 is a reply to message #434929] Mon, 14 July 2008 09:28 Go to previous message
Eclipse UserFriend
Hi,
SequenceGenerator is not supported on MappedSuperclasses, but if you just
move the SequenceGenerator annotation to the Id mapping that would work
fine, and as far as I know is perfectly valid. I agree that it's not
terribly clear, I often use the orm.xml schema to determine which
annotations belong with which mappings.

thanks,
Karen
Re: "Unresolved generator name" if no class is not annotated with @Entity [message #611120 is a reply to message #434930] Wed, 16 July 2008 18:27 Go to previous message
Eclipse UserFriend
Thanks, Karen. Really nice idea you shared about orm.xml... haven't
thought about it as a reference for using annotations :)
Previous Topic:Hibernate @GenericGenerator is not recognized by @GeneratedValue
Next Topic:persistence.xml and orm.xml are not copied to build folder
Goto Forum:
  


Current Time: Wed Jul 23 01:37:08 EDT 2025

Powered by FUDForum. Page generated in 0.07674 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top