Hide Clipart | Topics | Search
Log Out | Register | Edit Profile
Last 30 mins | 1 | 2

Calling Hibernate annotation experts..

Chalanachithram.com DB » New TF Industry Related » Archive through October 29, 2014 » Calling Hibernate annotation experts.. « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Bumper
Comedian
Username: Bumper

Post Number: 1996
Registered: 07-2014
Posted From: 204.80.58.133

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, October 29, 2014 - 04:04 pm:   Insert Quote Edit PostDelete PostView Post/Check IPPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Bump
Top of pagePrevious messageNext messageBottom of page Link to this message

Bumper
Comedian
Username: Bumper

Post Number: 1995
Registered: 07-2014
Posted From: 204.80.58.133

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, October 29, 2014 - 03:59 pm:   Insert Quote Edit PostDelete PostView Post/Check IPPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

First table with EmbeddedId , sepearte class for embeddedID

@Entity
@Table(schema = "Test1", name = "Example_Roles")
public class ExampleRoles implements Identifiable
{

private static final long serialVersionUID = 1L;
@EmbeddedId
private ExampleRolesKey key;




@Embeddable
public class ExampleRolesKey implements Serializable
{
@Column(name = "user_id", length = 10)
private Long userId;

@Column(name = "application")
private String application;

@Column(name = "x_role", length = 10)
private String xRole;


Second class with embeddedID , Seperate class for embeddedId


@Entity
@Table(schema = "Test1", name = "Example2_Roles")
public class Example2Roles implements Identifiable
{
private static final long serialVersionUID = 1L;
@EmbeddedId
private Example2RolesKey key;





@Embeddable
public class Example2RolesKey implements Serializable
{
@Column(name = "user_id", length = 10)
private String application;

@Column(name = "y_roles")
private String yRoles;



I am trying to excute

My query is


(List<example2roles>)getSession().createCriteria(Example2Rol es.class)
.createAlias("ExampleRoles", "egRls")
.add(Restrictions.eq("egRls.key.userId", userId))
.add(Restrictions.eq("egRls.key.application", application))
.add(Restrictions.eq("egRls.key.application", "aexample2RolesKey.application"))
.add(Restrictions.eq("egRls.key.xRole", "example2RolesKey.yRoles"))
.list() ;

please OnetoOne or manytoMany anotation rasi query excute ela chealo teliste konchem help cheandii

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x94972dc){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: