cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when importing the complex bean model into webdynpro

former_member219446
Participant
0 Kudos

hi all,

when importing the complex bean model into the webDynpro, it was returning the blank.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srini,

Please go through the weblog for complex bean model.

/people/balaramnaidu.bankuru/blog/2006/04/23/importing-complex-javabean-model-into-webdynpro-by-creating-relationships-for-the-model-classes

Regards, Anilkumar

former_member219446
Participant
0 Kudos

Hi AnilKumar,

I am using the same procedure to import the complex bean model in to webdynpro

but i got blank result when i click on the button Getempdetails. in the button action i called the Beanmodel method.

roberto_tagliento
Active Contributor
0 Kudos

Hi,

show your code for see and understand what could be wrong.

Here one mine example:

The model class


/*
 * Created on 27-ott-2006
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package tmp.userslist.comp.model.userslist;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.sql.DataSource;

import java.util.Collection;
import java.util.ArrayList;

import java.io.Serializable;


/**
 * @author rtagliento
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class AllUsers {
// implements Serializable {

	private Connection con;
	private ResultSet rs;
	private Statement stmt;
	private String SqlQuery;

	private Collection usersList = null;
	private UserElement users = null;
	
//	private Collection empDetailsList=null;
//	private EmpDetailsHelperClass  empdetails=null;

	
	public AllUsers(){
		con = null;	
		java.sql.ResultSet rs = null;
		rs = null;
		SqlQuery  = "SELECT * FROM TMP_USERSLIST ; ";
	}
	
	public Connection getConnection (){
			return con;
	}
	
	public void setConnection (Connection c){
		con = c;
	}
		
	public Collection getUsersList()
	{ 
		return usersList;
	}
		
	public UserElement getUsers()
	{ 
		return users;
	}
		
	public void setUsers(UserElement class1)
	{ 
		users = class1;
	}

	public void execute() throws Exception {
		String DEBUG = new String("");
		try {
			stmt = con.createStatement();
			rs = stmt.executeQuery(SqlQuery);
			usersList = new ArrayList();
			usersList.clear();
			while (rs.next()){
				users = new UserElement();
				
				users.setID(rs.getString("ID"));
				DEBUG += "ID: " + rs.getString("ID") + " | ";
				
				users.setName(rs.getString("NAME"));
				DEBUG += "NAME: " + rs.getString("NAME") + " | ";
				
				users.setSurname(rs.getString("SURNAME"));
				DEBUG += "SURNAME: " + rs.getString("SURNAME") + " | ";
				
				users.setBirthDay(rs.getDate("BIRTHDAY"));
				DEBUG += "BIRTHDAY: " + rs.getDate("BIRTHDAY").toString() + " ---------- ";
				

				usersList.add(users);
				
			}
			rs.close();
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new Exception(e.toString() + DEBUG);
		}
		
//		throw new Exception(new Integer(usersList.size()).toString() + DEBUG);
		
	}
		
}

when use it:

	
	AllUsers AllU = new AllUsers();
//	AllU.setConnection(myJdbc.getConnection());
	wdContext.nodeAllUsers().bind(AllU);
	wdContext.currentAllUsersElement().setConnection(myJdbc.getConnection());
	try {
		wdContext.currentAllUsersElement().modelObject().execute();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}	

Hope can help.

Bye

Answers (1)

Answers (1)

dhawal_joshi
Employee
Employee
0 Kudos

Hi ,

Could you post what exactly is the error log while importing. It could be checked at Window >> Show View >> PDE Runtime >> Error log. Usually i faced this issue when importer is not able to resolve some of the referenced beans/ classes in its classpath i.e the bean which you want to import if uses some other library's class then all the classes has to be part of the jars which are used for importing. Also there are some enhancements i have seen on the new version of ide . May be you could try that .

regards

Dhawal