Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

sandeeprajsingh tandon

Ranch Hand
+ Follow
since Mar 06, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sandeeprajsingh tandon

An old thread but i think this link can help

what is a resource in rest

and it says

The fundamental concept in any RESTful API is the resource. A resource is an object with a type, associated data, relationships to other resources, and a set of methods that operate on it. It is similar to an object instance in an object-oriented programming language, with the important difference that only a few standard methods are defined for the resource (corresponding to the standard HTTP GET, POST, PUT and DELETE methods), while an object instance typically has many methods.

Resources can be grouped into collections. Each collection is homogeneous so that it contains only one type of resource, and unordered. Resources can also exist outside any collection. In this case, we refer to these resources as singleton resources. Collections are themselves resources as well.

Collections can exist globally, at the top level of an API, but can also be contained inside a single resource. In the latter case, we refer to these collections as sub-collections. Sub-collections are usually used to express some kind of “contained in” relationship. We go into more detail on this in Relationships.

3 years ago
Old thread..
But still..
What i found was that i got errors of 'Function Name' must be declared in hibernate. I was running it via a Spring configured junittest.
I checked that my test classes werent taking connections strings to the right jdbc url...(A little foolish of me, but a solution none the less:))
Hi, I have a scenario like this





Now in my caller i am wanting to create full C or B objects


Now no matter what i do i.e A a = new A or A A = new b|c, i cant access b or c elements from parent's reference...obviously!.
This tells me that there is some inherent design flaw in the way classes are being organized. Is there a way to design this..any design pattern for this kind of scenario where 90% of the members exist in parent class and a complete object including child elements is to be created

Kindly suggest





I know its an old thread, but just wrote up the code as per the design pointers by some folks on this post. Hope it helps .
This code
- creates binary tree
- searches leaf nodes
- searches a node



The output is as such
1)
building tree with -> 70
Trying to insert 56
56 inserted to the left of 70
Trying to insert 59
found the node 56to the left of 70
Trying to insert 59
59 inserted to the right of 56
Trying to insert 45
found the node 56to the left of 70
Trying to insert 45
45 inserted to the left of 56
Trying to insert 43
found the node 56to the left of 70
Trying to insert 43
found the node 45to the left of 56
Trying to insert 43
43 inserted to the left of 45
Trying to insert 46
found the node 56to the left of 70
Trying to insert 46
found the node 45to the left of 56
Trying to insert 46
46 inserted to the right of 45
Trying to insert 100
100 inserted to the right of 70
Trying to insert 80
found the node 100to the right of 70
Trying to insert 80
80 inserted to the left of 100

2) Leaf Nodes are:
43
46
59
80

3)
Node 59 found at level 3 level below parent 56
Node 46 found at level 4 level below parent 45
5 years ago
Hi Folks...
Would it be better/worse if each vehicle knew the slot it was parked in and each slot knew the vehicle that is parked on it ie. Vehicle should have a ref to Slot and viceversa ?. That ways, the signature of the unpark could be unpark (uniqueToken, slotNumber). Unpark could simply get the slot on that number and free it up.

Please critique
Hi,
I wrote a query for getting all tables and columns that have a foreign key references to the given table's key. Can you help me write it efficiently. Basically i want to avoid the outermost select statement which is written only to get the "referenced column name"..is there a way to get the referenced column name in the 2nd select statement thereby avoiding the outermost.

Thanks Paul. I realize it reading your post that its not a good idea
Recording an example of
<code>INSERT INTO customers
( customer_id, firstname, surname )
VALUES
((SELECT MAX( customer_id ) FROM customers C) +1, 'jim', 'sock')</code>

-- Here i wanted to find out rows that have duplicate values in 2 columns, and find out the lesser id on these 2 rows.
select * from (SELECT ROW_NUMBER() OVER (PARTITION BY col1, col2 ORDER BY colid DESC) as row_number,
colid, col1, col2, col3, col4 from <some table> ) where row_number = 2;


-- here i wanted to find out latest bonds records a history table that tracks various status that a bond can have.
select a.bond_key, a.bond_status_tp_cd, a.status_date, a.maximum_date from
(select bond_key, bond_status_tp_cd, status_date, max(status_date)
OVER (PARTITION BY bond_key) as maximum_date from oltp.bond_status_history) a ,
oltp.bond b where b.bond_key = a.bond_key and a.status_date = a.maximum_date and b.IBL_CREATN_IND = 'Y' and a.bond_status_tp_cd in ('25', '100','110','109');


I finally solved it by Having a RunAs annotation on MDB and configuring its binding file[ibm-application-bnd.xml] like this.



and also adding @DeclareRoles({"Authenticated"}) on top of my sesion bean that is invoked from the mdb.
that gives me the principal from the sessioncontext.
ejb-jar.xml looks like this

thanks frits. I will check the documentation. I know in WAS i can get somethign like a SUBJECT but will need to see if that solves my problems.
Frits, you have understood me correctly.
MDBs are calling session bean but MDB has been configured as RUNAS(my user) also the Session Bean has been configured as RunAs(My User)

Are you saying, since MDBs dont have a client to access them, there is no way i can get callerPrincipal ?
Does RunAs not alter the caller principal atleast on Session beans?

What are my alternatives.
Actually my session bean is supposed to set principal object it recieves in Database Session
Its currently setting up 'UNAUTHENTICATED'. Is there a way i can pass the 'myuser' principal to my Session bean or is there any other option to pass the myuser user?



Hi, I am trying to invoke a Session Bean BeanA's methodA ()via an MDB MDB1. Both MDB1 and SessionBean BeanA has RunAs("my user") annotation on it.
The user has been mapped on WAS 7 to correct roles.

I am trying to get the CalllerPrincipal from,
- the ejbcontext in the methodA of the BeanA and
- the messagedrivenbeancontext in onMessage method of MDB1.

At both places i get UNAUTHENTICATED for the caller principal
How can i get the RunAs User in the session bean, BeanA's method A.
Solved it,
Configured the maven ejb plugin like this, - the dashClassifier now forces the classifer to be appended in the jar and in the ear.
<code> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<archive>
<manifest>
<customClasspathLayout>lib/${artifact.artifactId}${dashClassifier?}.${artifact.extension}</customClasspathLayout>
<!-- customClasspathLayout>lib/${artifact.artifactId}-$artifact.classifier.${artifact.extension}</customClasspathLayout-->
</manifest>
</archive>
</configuration>
</plugin></code>
7 years ago