List with multiple objects using Comparator
Hi,
I have a comparator to sort the fields of 2 objects. I have a resultlist which contains the CustomerAddressVO which contains the properties of both
Customer and Address entities List resultList<CustomerAddressVO>.
This CustomerAddressVO.java in turn have
private long id
private Customer customer;
private Address address;
Where Customer.java
will have properties of customer
Where Address.java
will have properties of address
Now i need to use the comparator for customer.getName() asc and address.id() desc, as i have mentioned the resultList doesn't directly contain this object as it contains CustomerAddressVO which in turn have those two object Customer and Address. Hence unless you iterate the list and retrieve the respective objects (customer, address) you cannot do the sorting through comparator. In such case how we can go about it. If you iterate the list also how we can pass the respective object to the compare() ? And more importantly we need to sort the columns of 2 different entites? Please clarify how we can go about it?
Thanks.
You can still do the sorting through a Comparator
The compare method should take
public int compare(CustomerAddressVO o1, CustomerAddressVO o2) { //..so you can then do
01.getCustomer().getName();
//and
o1.getAddress().getId() together with relevant null checks
Similar Messages
-
Hi,
Is it possible can we have a List with multiple Object (CustomerVO, OrderVO and AddressVO) in a single List? If so how we will define the generics for that List?
Please clarify.
Thanks.797836 wrote:
Guys, am I correct? Please clarify.If it works, it is correct. So try it.
I was more thinking along the line of this though according to what you described in your initial post:
Class ParentVO{
private CustomerVO customer;
private OrderVO order;
private AddressVO address;
// with getters and setters
}That way you don't need any list at all, if you only want to have access to these three objects. Just slap them in a ParentVO and use that.
Looking at it again I wonder if the ParentVO is needed even, there is a strong relationship between these three objects. An order has a customer and a customer has an address / an order has a billing/shipping address... -
Access list with multiple object groups
Hello Everyone,
I am using a cisco ASA 5525 with 8.6 code. I am trying to setup access list for oubound access meaning hosts accessing the internet. I have created an access list called outbound_access and did "access-groupc outbound_access in interface inside "
I am trying to use object-groups where ever i can. Here is an example.
object-group service obj_Meraki_outbound
service-object tcp destination eq 443
service-object tcp destination eq 80
service-object tcp destination eq 7734
service-object tcp destination eq 7752
service-object udp destination eq 7351
object-group network obj_Meraki_lan
network-object 10.2.11.0 255.255.255.240
network-object 10.5.11.0 255.255.225.240
object-group network obj_Meraki_pub
des This group lists all hosts associated with Meraki.
network-object host 64.156.192.154
network-object host 64.62.142.12
network-object host 64.62.142.2
network-object host 74.50.51.16
network-object host 74.50.56.218
object-group service obj_Meraki_outbound
service-object tcp destination eq 443
service-object tcp destination eq 80
service-object tcp destination eq 7734
service-object tcp destination eq 7752
service-object udp destination eq 7351
object-group network obj_Meraki_lan
network-object 10.x.x.x 255.255.255.240
network-object 10.x.x.x 255.255.225.240
object-group network obj_Meraki_pub
des This group lists all hosts associated with Meraki.
network-object host 64.156.192.154
network-object host 64.62.142.12
network-object host 64.62.142.2
network-object host 74.50.51.16
network-object host 74.50.56.218
I have tried tying all these groups together in multiple ways but cannot figure out how to do this. This what i think it should be "access-list outbound_access extended permit object-group obj_Meraki_outbound object-group obj_Meraki_lan object-group obj_Meraki_pub"
What i want is the use the service objects and the source network would be obj_Meraki_lan and destination would be obj_Meraki_pub. It seems the rules completely change when you use object groups. Can someone explain this maybe with a few examples. I am already using object groups in many acls but not for every element.
ThanksHi,
Seems to work on my test ASA
Attached it to my current LAN interface.
ASA(config)# packet-tracer input LAN tcp 10.2.11.1 12345 64.156.192.154 80
Phase: 1
Type: ROUTE-LOOKUP
Subtype: input
Result: ALLOW
Config:
Additional Information:
in 0.0.0.0 0.0.0.0 WAN
Phase: 2
Type: ACCESS-LIST
Subtype: log
Result: ALLOW
Config:
access-group outbound_access in interface LAN
access-list outbound_access extended permit object-group obj_Meraki_outbound object-group obj_Meraki_lan object-group obj_Meraki_pub
object-group service obj_Meraki_outbound
service-object tcp destination eq https
service-object tcp destination eq www
service-object tcp destination eq 7734
service-object tcp destination eq 7752
service-object udp destination eq 7351
object-group network obj_Meraki_lan
network-object 10.2.11.0 255.255.255.240
network-object 10.5.11.0 255.255.255.240
object-group network obj_Meraki_pub
description: This group lists all hosts associated with Meraki.
network-object host 64.156.192.154
network-object host 64.62.142.12
network-object host 64.62.142.2
network-object host 74.50.51.16
network-object host 74.50.56.218
Additional Information:
access-list outbound_access line 1 extended permit tcp 10.2.11.0 255.255.255.240 host 64.156.192.154 eq www (hitcnt=1) 0x4d812691
Also have used such configuration in some special cases where the customer has insisted on allow specific TCP/UDP ports between multiple networks. And nothing is stopping from adding ICMP into the "object-group service" also.
- Jouni -
List of Info Objects used in a process chain
Hi,
I have a master data process chain and in that process chain, close to about 50 Info objects are included. Rather than checking manually, I would like to know if there is any automated way to get the list of info objects used in a process chain.
Please let me know if there is any table that gives this information.
Thanks & Regards.following transparent tables store Process Chain related data... there you might get the information you are looking for..
RSEVENTCHAIN Event Chain Processing Event Table
RSEVENTHEAD Header for the event chain
RSEVENTHEADT Header for the event chain
RSPCCHAIN Process chain details
RSPCCHAINATTR Attributes for a Process Chain
RSPCCHAINEVENTS Multiple Events with Process Chains
RSPCCHAINT Texts for Chain
RSPCCOMMANDLOG System Command Execution Logs (Process Chains)
RSPCLOGCHAIN Cross-Table Log ID / Chain ID
RSPCLOGS Application Logs for the Process Chains
RSPCPROCESSLOG Logs for the Chain Runs
RSPCRUNVARIABLES Variables for Process Chains for Runtime
RSPC_MONITOR Monitor individual process chains
Regards,
Sharayu -
How to get list of custom objects used in abap report program?
Hi friends,
I have a requirement in which I have to scan the entire abap report and retrieve list of custom objects used in it for example custom tables, data elements, structures, table types etc,. Is there any provision in SAP like fuction modules to do this functionality? As of now I am coding everything manually where so many possibilities are there for all kinds of objects. Provide your answers and suggestions...
Thanks,
NasteraHi,
The best way to do this is environment analysis. Follow the steps:
1. Open se38, type in the program name (don't click on on display/change or create button, stay on first screen only)
2. Click on environment analysis button (hot key SHIFT+F4)
3. It will throw a pop-up, which will ask for type of object you want to see, which are linked /used by this program. select all (or may be if you are only interested in Tables, then select table only)
4. Hit 'Enter'
You will get the full list of all objects used in this report program. Just note down the one which starts with Z or Y and that's it.
Cheers,
Anid -
How to select value from list with multiple selections ?
HI,
i have a list with multiple selections where i show email address retrieved from database.
what i want to do is to send the selected email address to the invoiceedit.jsp.
please look at the following code which gives you the better idea.
<td class='smalltext'><select name="email" size="3" multiple="multiple">
<%
Connection conn = null;
Statement stmt = null;
Statement stmt_contactperson = null;
Statement stmt_address = null;
try{
conn = getREConnection();
stmt = conn.createStatement();
ResultSet rs = null;
rs = stmt.executeQuery("SELECT PROPERTYID, VALUE FROM PROPERTIES WHERE ENTITYID="+ g_strGroupID+" AND NAME = 'invoice_default_email'");
int numofrows = 0;
while(rs.next())
%>
<option value="<%= rs.getString("VALUE") %>" selected="selected"> <%= rs.getString("VALUE") %> </option>
<%
}//end of while
%>
</select>
<a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&add=1"><font color="#000000">Add</font></a>
<a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&email_to="><font color="#000000"> Edit</font></a> </td>thanksUse a form button instead of a link so that you can send it as a request parameter to the server. In the server side just use HttpServletRequest#getParameterValues() to obtain all values for the given parameter name. If you really need a link rather than a button, then use Javascript to submit the form on click of the link.
That said, your design is bad. Java code belongs in Java classes, not in JSP files. Database access logic belongs in a DAO class. Business and controlling logic belongs in a Servlet class. Only presentation logic belongs in the JSP file. Avoid scriptlets as much as possible and use JSP EL and/or JSTL instead. -
hello all ,
how to create a list with multiple columns ? can anyone share some examples or code snippetsWhat I would usually do is create a movieclip/sprite that contains a row with every column in it (each column being a textfield). Then pile up the rows one atop the other (using Actionscript) as they are populated with data.
-
Spiral/Vortex with Multiple Objects
Hi, all
I'm trying to replicate this image from Shutterstock with multiple objects to create this spiral vortex.
http://image.shutterstock.com/display_pic_with_logo/849265/101051014/stock-vector-card-sui t-hearts-diamonds-spades-and-clubs-playing-cards-op-art-vector-illustration-101051014.jpg
I looked up tutorials like this: http://vectorguru.com/tutorials/how-to-distribute-objects-along-spiral.html
Where I can put say the hearts on one spiral.
But, the image seems to be multiple spirals in a uniform and equidistant manner. I would like to know how to go about making a "vortex" with multiple objects very similar if not the same to this fashion.
Please advise.
Thanks!Hi lotrismylife,
I was able to get a similar effect using the following steps:
Create a pattern brush of the 4 symbols next to each other (that way you can distribute them easily around the circle).
Start with the outermost circle, and apply the new pattern brush to it's stroke.
Expand the circle
Object > Transform > Transform Each (CTRL + ALT + SHIFT + D)
Set the horizontal & vertical scale to be smaller than 100% (you must experiment with this, depending on how big the gaps between circles must be)
Set the rotation angle (depending on how much each circle must rotate)
Click on Copy
Now continually press CTRL D - this will continue to create a copy of the outermost circle that is x % smaller, and x degrees rotated.
End result: -
PC-UI: F4 with multiple object selection
Hi!
I implemented a F4-application with multiple object selection.
Now I want to give back some data to the application that called the f4 or I'd like to call a method of this class. How can I find the correct instance of this class?
Thanks in advance!
JörnHi!
I used a DDIC table to exchange data. I forwarded the object_key and the F4-help application inserted the multiple objects with that key in that table.
The application which called the F4-help looked to the table (after pressing a button), grabbed the data and deleted the data in the DDIC table afterwards.
I hope that helps.
Jörn -
How can i create excel sheet with multiple tabs using utl file?
how can i create excel sheet with multiple tabs using utl file?
any one help me?Jaggy,
I gave you the most suitable answer on your own thread yesterday
Re: How to Generating Excel workbook with multiple worksheets -
File to RFC with multiple records using BPM Scenario Error...!!!
Hello Guru's,
I have done the File to RFC with multiple records using BPM scenario as per the Materiel available in the sdn.sap. This involves BAPI (BAPI_MATERIEL_AVAILABILITY). I have done exactly the same what is their in the materiel. SXI_CACHE is also giving return value " 0 ". File is getting deleted from the source directory, but no file in target directory. SXMB_MONI is also showing no error (black Flag). BPM is also error free. Checked the interfaces also.
Can any one tell me what mistake would i have done.
Thanks in advance.Hi,
There is one similar discussion I found,
FTP TO RFC using BPM
Thanks
Swarup -
[svn:fx-trunk] 10943: Fix to dragging from List with multiple-selection
Revision: 10943
Author: [email protected]
Date: 2009-10-08 15:46:27 -0700 (Thu, 08 Oct 2009)
Log Message:
Fix to dragging from List with multiple-selection
- The fix is to postpone the selection commit until we make sure the user has not started a drag gesture.
- Exclude the dragEnabled, dropEnabled, dragMoveEnabled properties for DropDownList
QE notes: None
Doc notes: None
Bugs: None
Reviewer: Deepa
Tests run: checkintests, mustella List, DropDownList
Is noteworthy for integration: No
Modified Paths:
flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as
flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as -
Creating Select List with multiple columns
I want to create a select list with multiple columns. I followed the demo application model described in the by Denes Kubicek (Currently my reference for APEX !!)
The code is as follows:
CREATE OR REPLACE FUNCTION getcrops(p_cropid IN NUMBER)
RETURN VARCHAR2
IS
v_cropid VARCHAR2 (400);
v_fcode VARCHAR2 (400);
v_product VARCHAR2 (400);
v_var VARCHAR2 (400);
v_fname VARCHAR2 (400);
v_acres VARCHAR2 (400);
v_style_start VARCHAR2 (400);
v_style_end VARCHAR2 (400);
v_return VARCHAR2 (400);
BEGIN
FOR c IN (select "CROP"."CROPID" as "CROP ID",
"CROP"."FIELDCODE" as "FIELD CODE",
"CARROTPRODUCTLIST"."CARROTPRODUCTNAME" as "PRODUCT",
"VARIETYLIST"."VARIETYNAME" as "VARIETY",
"FIELD"."FIELDNAME" as "FIELD NAME",
"CROP"."SIZEINACRES" as "ACRES"
from "FIELD" "FIELD",
"CARROTPRODUCTLIST" "CARROTPRODUCTLIST",
"VARIETYLIST" "VARIETYLIST",
"CROP" "CROP"
where "CROP"."CARROTPRODUCTTYPE"="CARROTPRODUCTLIST"."CARROTPRODUCTID"
and "CROP"."VARIETYID"="VARIETYLIST"."VARIETYLISTID"
and "CROP"."FIELDID"="FIELD"."FIELDID")
LOOP
v_cropid := TO_CHAR (c.'CROP ID', 'FML999G999G999G999G990');
v_fcode := c.'FIELD CODE';
v_product := c.'PRODUCT';
v_var := c.'VARIETY';
v_fname :=c.'FIELD NAME';
v_acres :=c.'ACRES';
FOR i IN 1 .. 12 - LENGTH (c."CROP ID")
LOOP
v_cropid := v_cropid || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'FIELD CODE')
LOOP
v_fcode := v_fcode || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'PRODUCT')
LOOP
v_product := v_product || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'VARIETY')
LOOP
v_var := v_var || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'FIELD NAME')
LOOP
v_fname := v_fname || ' ';
END LOOP;
FOR i IN 1 .. 12 - LENGTH (c.'ACRES')
LOOP
v_acres := v_acres || ' ';
END LOOP;
v_return := v_cropid || v_fcode || v_product || v_var || v_fname || v_acres;
END LOOP;
RETURN v_return;
END;
I created this anonymous Pl/SQL function at a application level ..Then I followed up to create a select list with a function inside. However I could not create select list with the command suggested in the demo which is
select getcrops(cropid) d, cropid r from crop;
APEX (2.1) returns a error message. What am I missing ? Should the function be called from somewhere else after creating a regular select list..? Where the functions (Pl/SQL) should be ideally stored for application level access..? and for across application level access ? How can I check the function works good. Help is appreciated.Still really one column.
If they need to be independent then you've got to have three selection lists.
% -
Selection list with multiple columns
How can i create a selection list with multiple columns?
Still really one column.
If they need to be independent then you've got to have three selection lists.
% -
Select list with multiple columns
I want to create a select list with multiple column option. What are the options. Any developments in apex 3.0.1 ? Thanks in advance. I tried the tutorials by Kubicek.
I am kind of stuck to see the function entry inside LOV definition returns a error.Still really one column.
If they need to be independent then you've got to have three selection lists.
%
Maybe you are looking for
-
How to log in to Service Desk to create sample message to SAP?
Dear all, How to log in to Service Desk under my Solution Manager server to create sample message to SAP under Component: SV-SMG-SUP? Regards GN
-
LMS 3.0.1 SNMP working.
Hi all. After i upgraded my MDF to 1.50 the SNMP is not working. I alread applied the fix to bug CSCsl00042-0 but still not working. The SO is solaris 9. Follow the package details. 1. CiscoWorks Common Services 3.1.1 2. CiscoView 6.1.7 3. LMS Port
-
Default description for Activity
Hi Experts, I need to set a default text for the description field of an activity type. How can I do so? Best regards, Cristina
-
More specific: I want to create a two-level navigation, whit both levels in horizontal direction. Example: 1st level: Products, 2nd level: Type 1, Type 2, Type 3 etc
-
Error Message and Crash at Startup
Every time I try to start PP I get message /ppro721/releases/2013.10/shared/adobe/MediaCore/ASL/Foundation/Make?Mc/../../Src/Directo ryRegistry.cpp-283 I unistalled and reinstalled program and updates, but no luck. Any ideas?