Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:58 Go to next message
Vadim Dmitriev is currently offline Vadim DmitrievFriend
Messages: 74
Registered: July 2009
Member
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 13:28 Go to previous messageGo to next message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
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 22:27 Go to previous message
Vadim Dmitriev is currently offline Vadim DmitrievFriend
Messages: 74
Registered: July 2009
Member
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 13:28 Go to previous message
Karen Butzke is currently offline Karen ButzkeFriend
Messages: 220
Registered: July 2009
Senior Member
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 22:27 Go to previous message
Vadim Dmitriev is currently offline Vadim DmitrievFriend
Messages: 74
Registered: July 2009
Member
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: Thu Apr 18 23:38:30 GMT 2024

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

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

Back to the top