Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to configure Inner Class as an Entity in Mapping File(How to configure Inner Class as an Entity in Mapping File)
How to configure Inner Class as an Entity in Mapping File [message #1229491] Thu, 09 January 2014 14:58 Go to next message
Sendhil Kumar is currently offline Sendhil Kumar
Messages: 7
Registered: January 2014
Junior Member
Hi All,

Am new to eclispe link.

How I can configure inner class of a class as entity in eclipse link mapping file,

For example, as shown below, if I have to configure UserVo.AppUser, where AppUser is the inner class,


public class UserVo extends AbstractIdentifiableValueObject {

private AppUser appUser;

public UserVo(String userId, AppUser appUser) {
super(safeDeriveIdentity(userId, appUser, globalUser));
this.appUser = appUser;
}

public AppUser getAppUser() {
return(appUser);
}


public static class AppUser extends AbstractIdentifiableValueObject {
private UserGroupVo.Identity group;
private UserGroupVo.Identity selectedGroup;

...................

}
}



Can I declare it as shown below?

<description>AppUser</description>
<entity name="ApplicationUser" class="com.csfb.csar.exman.shared.work.UserVo.AppUser" >
<table name="VEM_USER"></table>
<attributes>
<id name="dbId" type="java.lang.Long" >
<column name = "USER_ID"/>
</id>

............................

Re: How to configure Inner Class as an Entity in Mapping File [message #1229530 is a reply to message #1229491] Thu, 09 January 2014 16:37 Go to previous message
Brian Vosburgh is currently offline Brian Vosburgh
Messages: 132
Registered: July 2009
Senior Member
As with Class.forName(String), member class names must use '$' as the separator:
"com.csfb.csar.exman.shared.work.UserVo$AppUser"
Previous Topic:Migrating from Hibernate to EclipseLink
Next Topic:Setter Methods not getting invoked with eclispe link
Goto Forum:
  


Current Time: Sun Oct 26 08:52:23 GMT 2014

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

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