Phil 8.15.17

7:00 – 8:00 Research

8:30 – 6:00 BRI

  • Remembered my bike shoes, but it may rain all day
  • Wrote up a note to T about burning PhD hours for the Oct1 CHIIR paper deadline
  • Need to write up the dev plan for GeoMesa into the EIP pattern (include a strawman use case?)
  • Back to learning Spring
  • And here is a way to populate a nested bean:
    <bean id="countryParent" abstract="true" class="org.springframework.chapter2.pojos.EmployeeImpl"><!-- this just gets one abstract class implementation -->
        <property name="country" value="USA"/>
    </bean>
    
    <bean id="employeeServiceBean"
          class="org.springframework.chapter2.service.EmployeeServiceImpl">
        <property name="employeeList">
            <list>
                <bean parent="countryParent" class="org.springframework.chapter2.pojos.EmployeeImpl">
                    <property name="employeeAge" value="10"/>
                    <property name="employeeName" value="Ten Tin"/>
                    <property name="employeeId" value="1"/>
                </bean>
                <bean parent="countryParent" class="org.springframework.chapter2.pojos.EmployeeImpl">
                    <property name="employeeAge" value="11"/>
                    <property name="employeeName" value="Eleven Even"/>
                    <property name="employeeId" value="2"/>
                </bean>
                <bean parent="countryParent" class="org.springframework.chapter2.pojos.EmployeeImpl">
                    <property name="employeeAge" value="12"/>
                    <property name="employeeName" value="Twelve Elve"/>
                    <property name="employeeId" value="3"/>
                </bean>
            </list>
        </property>
    </bean>
  • That sends the instanced objects to setEmployeeList that has to take a list of objects. To get it typed, I did this:
    @Override
    public void setEmployeeList(List<Object> employeeList) {
        for(Object o : employeeList){
            Employee e = (Employee)o;
            setEmployee(e);
        }
    }
  • A typed employee is added as follows:
    @Override
    public void setEmployee(Employee employee) {
        employees.add(employee);
    
    }
  • IntelliJ will extract an interface and rename your class. How cool!
  • Printed, signed and scanned my credit card agreement.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: