Deepa Malhotra

Greenhorn
+ Follow
since Oct 31, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Deepa Malhotra

I can create MyObj objects in following two ways: whats the fundemental difference?

Class class = Class.forName(..)
MyObj obj1 = (MyObj) class.newInstance(..)
MyObj obj2 = new MyObj();
19 years ago
thanks for the reply.
If I'm going to store a new user account in the database, then I dont really use the user/group/role features provided by the server???
Are you saying that user/group/role features provided by the server is not dynamic and that if a new user is to be added, only the administrator got to do this manually and restart the server?
20 years ago
Many server have facility to create users, group and assign roles. (typically stored in xml file, eg tomcat-users.xml).
What should I do in my appln so that people can use the on-line form and create a default user/group/role for themselves? Should the appln access the xml file and write to it?
20 years ago
Well. I already have the application in CMP. Is there any way to get these requirements implemented.
How can I have a find method someting like this in CMP:
Question 1:
findByPersonNames(String [] names)
If names array is null, I should get all Persons.
If names array has one name, then I sould get one Person
If names array has two names, then I sould get two Persons, and so on.
Question 2:
I have the following three find methods:
findByName(String name)
findByAge(int age)
findByNameAndAge(String name, int age)
Can I combine the above three method into one, like
findByCombinedCondition(String name, int age)
If age is 0, this should work like the first method
If name is null, this should work like the second method
If age and name are present, this should work like the third method
CMR
I did some research and here is what I think:
Lets say you have two tables that do not have any common columns. Create your entity beans. After this, if you establish a CMR between these beans, the container automatically creates a new table with necessary columns that can serve as a link between the original two tables.
Expert opinion please!
CMR
Thanks Rashmi,
I know I'm kind of confused on this. Are you saying that if the Persons Table and Credit Card table do not have a foreign key constraint, the corresponding entity beans can not have a relationship??
CMR
Lets say I have Person entity bean and Credit card entity bean. I'm defining a 1:* relationship between them.
Lets say the current status in my appln is Person A has 5 credit cards and Person B has 3 credit cards. Where is this info stored. What happens when I move my appln to another container. How is this info not lost?
We typically lookup the home interface and then get the remote interface from it. Why not directly lookup the remote interface as this is also a Remote Object?
I want a login for my application which will be used by 1000 users. each have username, password and a role based access. Should I build a table with username, password, role and manage the authentication and authorization thro my code. How would this technique compare to other standard ways used in huge applications.
Here is the link for that tutorial:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP.html
League and Teams have 1:* relationship. One League can have many teams and every team just belongs to League.
Thanks Preadeep.
But if you look at the CMP example in Sun's tutorial, we have a Teams entity bean and a League entity bean. The underlying tables do not have any common columns, but the beans have a 1:* relationship established thro CMR.
Am I making sense?
Lets say I have EMPLOYEE table and a DEPT table. EMPLOYEE table has the deptid which is the foreign key. And I can establish CMR between the two entity beans.
If EMPLOYEE table does not have deptid column (ie there is no common columns between tables) can I still establish a CMR between the two entity beans?
Question 1:
Can I have a helper class (a regular java bean) for my entity beans? If yes, should it be added to the ejb jar.
Question 2:
A Entity bean BMP has instance variables representing the columns in the database. The bean can also have additional instance variables. Can entity bean CMP have additional instance variables?
I have my appln developed with jdeveloper. when I deploy to the embeded server, no errors, works fine. when I try to deploy to external oc4j server, I get the following errors:
java.lang.InstantiationException: Failure to initialize EJBQL descriptors: java.lang.RuntimeException: No method found for XML query element: mypackage1.DepartmentsLocalHome
void com.evermind.server.ejb.deployment.EJBPackage.initializeEjbqlDescriptors(byte[], int, int)
EJBPackage.java:2075
any suggestions?