AnilPrakash Raju

Ranch Hand
+ Follow
since Jul 26, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by AnilPrakash Raju

Thanks Rob.

I can't change the names of the fields in the table. It is fixed. I tried to change the name of the columns eg.
@JoinColumn(name = "VersionStartDate1", referencedColumnName = "VersionStartDate", insertable = false, updatable = false)

But i got an error when i ran the application again

Invalid column name 'VersionStartDate1'
org.hibernate.exception.SQLGrammarException: could not initialize a collection:

thanks
Hi,

I am trying to do a @manyToMany mapping in my code and i am getting a org.hibernate.MappingException: Repeated column in mapping for collection error.

The table is I have got:

- Table PassengerSegmentVersion -primary keys {VersionStartDate, passengerID, SegmentID }
- Table PassengerLegVersion - primary keys {VersionStartDate, passengerID, SegmentID , InventoryLegID}
- Table InventoryLegVersion - primary keys {VersionStartDate, InventoryLegID }


In my PassengerSegmentVersion Class i have got :

@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "PassengerLegVersion",
joinColumns = {
@JoinColumn(name = "PassengerID", referencedColumnName = "PassengerID"),
@JoinColumn(name = "SegmentID", referencedColumnName = "SegmentID"),
@JoinColumn(name = "VersionStartDate", referencedColumnName = "VersionStartDate")},
inverseJoinColumns = {
@JoinColumn(name = "InventoryLegID", referencedColumnName = "InventoryLegID"),
@JoinColumn(name = "VersionStartDate", referencedColumnName = "VersionStartDate", insertable = false, updatable = false)}
)
private List<InventoryLegVersion> inventoryLegs = new ArrayList<InventoryLegVersion>();


I have read in other topics relating to this issue to use insertable = false and updatable = false. i have tried it but still getting same error. I have not included any mapping in the InventoryLegVersion class since i don't need to use it. Do i need to do it?

Any suggestions?

Thanks in advance

Anil
Hi Craig,

Just wanted to know how good are the examples(code) in the book? What i mean is that in some books, examples(code) are given without really helping in setting up to do the examples so it is quite hard to test the codes and really gets annoying.

Thanks

Anil
14 years ago
Hi,

How does Collections.sort work?

I got a list of raw data which is ordered properly, and a comparator which has a list of code is sorted against.

Collections.sort(rawDataList, codeSortList)

when i run this I get a result that:
it is sorted against the code properly( which i want) but within each code sorted, the list is not ordered properly.

Thanks in advance

Anil
15 years ago
Thanks Campbell,

I do round it off to 2 decimal points, but if the last digit is 0, i get only decimal point.

Anil
15 years ago
Hi,

I need to return a double value with two decimal points ( even if the last decimal value = 0) I have used numberFormat but returns a string and when I convert the string back to double i lose the last decimal vale if equal to 0.

eg from numberFormat i get a string with value 23.30, and when i convert it to double, it gives 23.3

any suggestions will be greatly appreciated.

Thanks

Anil
15 years ago
Hi,

Not sure if i am in the right forum.
Currently i am writing some web services using spring framework. i am trying to validate the input(checking for maxlength) eg.
<xsd:element name="reference" minOccurs="1" maxOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

i am using soapui to test my web services. currently i can insert more than the maxlength. It does not seem to be validating the request field. Is there any parameters(or files) in the framework that i look for to force the input fields to be validated?

Thanks in advance.

Anil
Hi,

I am converting jsp pages to web services. In jsp pages you have hidden fields. how can i convert this to a xsd:element field so the user should not see it, but if they do see it, they cannot change the values.

i tried using:
xsd:element name="test" type="xsd:string" fixed="N"

but i could change the value for element 'test'.

Any suggestions?

Thanks in advance

Anil
Hi,

I am writing some junit test cases that involves creating messageContext.
Can anyone give any suggestions about how i can creat and test meeageContext?

Thanks in advance

Anil
16 years ago
Hi,
Not sure if i am posting in the right forum. Sorry if i am posting in the wrong forum.

for my webservices i was thinking of putting the content type in my schema to show to the user what foramt the result is received, but i am getting some errors.

<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
elementFormDefault="unqualified" attributeFormDefault="unqualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="1.0"
targetNamespace="http://www.test.com/test/ws/schemas/core">

<xsd:import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="http://www.w3.org/2005/05/xmlmime"/>

<xsd:element name="MyBinaryData" xmime:expectedContentTypes='image/jpeg' >
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary" >
<xsd:attribute ref="xmime:contentType" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>

</schema>

i am getting the following errors when i try to build it:

Cannot resolve the name 'xmime:contentType' to a(n) 'attribute declaration' component.

The content of '#AnonType_MyBinaryData' is invalid. Element 'attribute' is invalid, misplaced, or occurs too often.

Any suggestions would be greatly appreciated

thanks in advance

Anil
16 years ago
Hi,

i am using spring web services and i have run into some problems.

I want to have a new endpoint per connection, or some method to pass the dto between the interceptors and then to the endpoint invokeInternal method.

Whats happening now is that once the server is booted and i type the input fields and press run, i get the right results. when i type in different input fields, the results that i get is the results of the the first run.

I am not whether this is due to using �org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping" for my endpoint mapping class that is causing the context to be asked for once rather than having a newpoint per connection.

I have also setup the bean in the web service application context files to have the scope ='prototype'.

Any suggestions?

thanks in advance

Anil
16 years ago
Hi Lasse,
How useful is the book in applying Testing on existing projects? i am working on an existing project, but doing some enhancements to the project

thanks

Anil
17 years ago
Hi,
I need to search for a pattern in a string. I have done that using:
Pattern p = Pattern.compile(myPattern);
Matcher m = p.matcher(String);
boolean result= m.find();

while (result) {
System.out.println(m.group());
result4= m.find();
}

What i want to do is replace the first two characters of the each result with && and update it to the main string?

Any ideas about how i could go about doing this?

Thanks in advance

Anil
17 years ago