Gayatri Ganesh

Ranch Hand
+ Follow
since Dec 23, 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 Gayatri Ganesh

Hi,

I am new to tapestry and come from a struts background.

I have a page which has a couple of textfields.
when these textfields are displayed the 1st time, i retrieve the values for these from the database using 2 parameters (as a part of the where clause) passed to this page from the previous page .
these are editable textfields. so if the user changes these values and clicks the save button, this page should save this data back to the database.
But it cannot do so because it has lost the 2 parameters which were intially passed to this page.

How do i get about this problem ?

Thanks,
Gayatri.
Hi,

I need to save or update an object to the database.
I use the seeion.saveOrUpdate(myobj) method but it always updates the object even the 1st time when the object is created. And hence the object is never stored to the db.


The hbm file is as follows :

<class name="MyClass" table="Mytable" lazy="true" dynamic-update="true" dynamic-insert="true">
<meta attribute="extends">MySuperClass</meta>
<cache usage=nonstrict-read-write"/>
<composite-id class="MyPK" name=Id">
<key-many-to-one column="mycolumn1" name="myColumn1" class="MyColumn1"/>
<key-many-to-one column="mycolumn2" name="myColumn2" class="MyColumn2"/>
</composite-id>
....

can anyone please tell me what is wrong ?

thanks
Gayatri
Hi,

I have a bean definition as follows in my spring-context.xml file:

<bean id="myService"
class="com.try.services.MyServiceImpl"
singleton="true" lazy-init="true" autowire="constructor"
dependency-check="default" >
</bean>

and

public class MyServiceImpl extends BaseService implements MyService {

private AnotherService as;

public MyServiceImpl (SessionFactory sf, AnotherService as){
super(sf);
this.as = as;
}
}

'myService' bean is autowired by constructor.
what i understand by autowire='constructor' is :
create this bean instance using the constructor and arguments to the constructor are defined as other beans the spring-context.xml.
so i would have to write
<constructor-arg>..........</constructor-arg>
in the bean definition

but how does the above code work without the <onstructor-arg>

thanks,
Gayatri
Hi Everyone,

Domian objects are the objects in the middle tier of the application which model the application.
Till now I have been having properties on the domain objects and corresponding mutators.
Eg:

Today I was reading a book which has a domain object with along with he properties and its mutators have methods which actually contain the business logic.

I am wondering is this a good practise to put the business logic in domain objects ?

Thanks,
Gayatri

[Edited to add code tags - Paul Sturrock]
[ September 20, 2006: Message edited by: Paul Sturrock ]
Hi,

I downloaded apache-tomcat-4.1.34 and unzipped the file into
C:\tomcat\ so this is the directory structure i have

C:\tomcat\apache-tomcat-4.1.34
i want to create myapplication.xml.

the documents tell me to go under C:\tomcat\apache-tomcat-4.1.34\conf\catalina\localhost
and create myapp.xml file.

but there is no catalina folder under C:\tomcat\apache-tomcat-4.1.34\conf
so i created catalina\localhost and put myapp.xml file there.

when i try to hit http://localhost:8080/myapp, I get a file not found 404 error.
can anyone please point out what i did wrong.

thanks,
Gayatri
17 years ago
thanks Satou for the reply.
So do you mean if

<bean id="person" class="com.try.Person">
<property name="name"/>
</bean>

And I have defined Person bean as below :
public class Person {
private String name;

public void setName(String s) {
name = s;
}
}

Then say in my Manager class I Should say :

person.setName("abc");
if i did not call the above setter method i would get an exception ?

Thanks,
gayatri
Hi Everyone,

I am reading the Spring documentation at http://static.springframework.org/spring/docs/2.0.x/spring-reference.pdf on page 37, there is a topic on checking dependencies.

What I don't understand is how by default the Spring IoC Container's default is to NOT check for dependencies.
Because I have an applicationContext.xml with no dependency-check defined (so it should have the default value = no dependency-check), but whenever i deploy a bean without the depending bean i get an error when i start/restart tomcat. For example, I have 2 beans, say 'beanA' and 'beanB' like below

<bean id="beanA" ref="beanB"/>

<bean id="beanB" >
<....>
</bean>

if i did not define 'beanB' and only have the 1st line : <bean id="beanA" ref="beanB"/> then
on Tomcat startup it complains. then how are we saying that Spring IoC Container has no dependency-check by default.
Can anyone please explain this ?

thanks,
Gayatri
hi,

In EJB 3.0 i do not understand the difference between the create() method vs the persist().
When should we use the create() and when should the persist() method be used ?

Thanks,
Gayatri
Hi,

Hibernate has methods for finding - find() and loading load().
In my opinion, correct me if i am wrong, both do the same task.
Find that record and then return it.
I am unclear when we should use the find() method versus the load() method.

Thanks,
Gayatri
Thanks Mark and Dave.
17 years ago