// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/data/CompanyBean.java
// @Entity
// @Table(name = "companies")
// public class CompanyBean implements Identifiable, Serializable {
// 
//     private static final long serialVersionUID = 6782475394818123635L;
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(unique = true, nullable = false)
//     private Integer companyId;
// 
//     @Column(nullable = false) private String name;
//     @Column(nullable = false) private String street;
//     @Column(nullable = false) private String city;
//     @Column(nullable = false) private String state;
//     @Column(nullable = false) private String zip;
// 
//     @Override
//     public Integer getId() {
//         return companyId;
//     }
// 
//     public Integer getCompanyId() {
//         return companyId;
//     }
// 
//     public void setCompanyId(final Integer companyId) {
//         this.companyId = companyId;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(final String name) {
//         this.name = name;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(final String street) {
//         this.street = street;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(final String city) {
//         this.city = city;
//     }
// 
//     public String getState() {
//         return state;
//     }
// 
//     public void setState(final String state) {
//         this.state = state;
//     }
// 
//     public String getZip() {
//         return zip;
//     }
// 
//     public void setZip(final String zip) {
//         this.zip = zip;
//     }
// 
// }
// 
// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/data/GenericDataProvider.java
// public interface GenericDataProviderFactory<T2 extends Serializable> {
//     /**
//      * Factory method for creating a new {@link GenericDataProvider} given a type.
//      * @param type the entity type to associate with this {@link GenericDataProvider}.
//      * @return an {@link GenericDataProvider}.
//      */
//     public GenericDataProvider<T2> create(final Class<T2> type);
// }
// 
// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/data/PeopleDataProvider.java
//     public interface PeopleDataProviderFactory {
//         /**
//          * Factory method for creating a new {@link PeopleDataProvider}.
//          * @param companyId company to filter on, or null for everything.
//          * @return an {@link PeopleDataProvider}.
//          */
//         public PeopleDataProvider create(final Integer companyId);
// }


import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.name.Names;
import com.metrink.croquet.examples.crm.data.CompanyBean;
import com.metrink.croquet.examples.crm.data.GenericDataProvider.GenericDataProviderFactory;
import com.metrink.croquet.examples.crm.data.PeopleDataProvider.PeopleDataProviderFactory;
package com.metrink.croquet.examples.crm;


/**
 * A Guice module that binds dependencies.
 */
public class CrmModule extends AbstractModule {

    private final CrmSettings settings;

    /**
     * Constructor that takes a settings instance.
     * @param settings the settings.
     */
    public CrmModule(final CrmSettings settings) {
        this.settings = settings;
    }

    @Override
    protected void configure() {
        bind(String.class).annotatedWith(Names.named("current-user")).toInstance(settings.getCurrentUser());

// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/data/CompanyBean.java
// @Entity
// @Table(name = "companies")
// public class CompanyBean implements Identifiable, Serializable {
// 
//     private static final long serialVersionUID = 6782475394818123635L;
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(unique = true, nullable = false)
//     private Integer companyId;
// 
//     @Column(nullable = false) private String name;
//     @Column(nullable = false) private String street;
//     @Column(nullable = false) private String city;
//     @Column(nullable = false) private String state;
//     @Column(nullable = false) private String zip;
// 
//     @Override
//     public Integer getId() {
//         return companyId;
//     }
// 
//     public Integer getCompanyId() {
//         return companyId;
//     }
// 
//     public void setCompanyId(final Integer companyId) {
//         this.companyId = companyId;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(final String name) {
//         this.name = name;
//     }
// 
//     public String getStreet() {
//         return street;
//     }
// 
//     public void setStreet(final String street) {
//         this.street = street;
//     }
// 
//     public String getCity() {
//         return city;
//     }
// 
//     public void setCity(final String city) {
//         this.city = city;
//     }
// 
//     public String getState() {
//         return state;
//     }
// 
//     public void setState(final String state) {
//         this.state = state;
//     }
// 
//     public String getZip() {
//         return zip;
//     }
// 
//     public void setZip(final String zip) {
//         this.zip = zip;
//     }
// 
// }
// 
// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/data/GenericDataProvider.java
// public interface GenericDataProviderFactory<T2 extends Serializable> {
//     /**
//      * Factory method for creating a new {@link GenericDataProvider} given a type.
//      * @param type the entity type to associate with this {@link GenericDataProvider}.
//      * @return an {@link GenericDataProvider}.
//      */
//     public GenericDataProvider<T2> create(final Class<T2> type);
// }
// 
// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/data/PeopleDataProvider.java
//     public interface PeopleDataProviderFactory {
//         /**
//          * Factory method for creating a new {@link PeopleDataProvider}.
//          * @param companyId company to filter on, or null for everything.
//          * @return an {@link PeopleDataProvider}.
//          */
//         public PeopleDataProvider create(final Integer companyId);
// }


// Path: croquet-examples/src/main/java/com/metrink/croquet/examples/crm/CrmModule.java
import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.name.Names;
import com.metrink.croquet.examples.crm.data.CompanyBean;
import com.metrink.croquet.examples.crm.data.GenericDataProvider.GenericDataProviderFactory;
import com.metrink.croquet.examples.crm.data.PeopleDataProvider.PeopleDataProviderFactory;

package com.metrink.croquet.examples.crm;


/**
 * A Guice module that binds dependencies.
 */
public class CrmModule extends AbstractModule {

    private final CrmSettings settings;

    /**
     * Constructor that takes a settings instance.
     * @param settings the settings.
     */
    public CrmModule(final CrmSettings settings) {
        this.settings = settings;
    }

    @Override
    protected void configure() {
        bind(String.class).annotatedWith(Names.named("current-user")).toInstance(settings.getCurrentUser());

        install(new FactoryModuleBuilder().build(PeopleDataProviderFactory.class));