diff --git "a/Documenta\303\247\303\243o.docx" "b/Documenta\303\247\303\243o.docx" new file mode 100644 index 00000000..ce02e2b7 Binary files /dev/null and "b/Documenta\303\247\303\243o.docx" differ diff --git a/teste/.bowerrc b/teste/.bowerrc new file mode 100644 index 00000000..fcaf558c --- /dev/null +++ b/teste/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory" : "src/main/webapp/js/lib" +} \ No newline at end of file diff --git a/teste/.classpath b/teste/.classpath new file mode 100644 index 00000000..9f372a20 --- /dev/null +++ b/teste/.classpath @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/teste/.project b/teste/.project new file mode 100644 index 00000000..99524b8d --- /dev/null +++ b/teste/.project @@ -0,0 +1,60 @@ + + + teste + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.jboss.tools.jst.web.kb.kbbuilder + + + + + org.hibernate.eclipse.console.hibernateBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.jboss.tools.cdi.core.cdibuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.hibernate.eclipse.console.hibernateNature + org.eclipse.wst.jsdt.core.jsNature + org.jboss.tools.jst.web.kb.kbnature + org.jboss.tools.cdi.core.cdinature + + diff --git a/teste/.settings/.jsdtscope b/teste/.settings/.jsdtscope new file mode 100644 index 00000000..cafc6a8e --- /dev/null +++ b/teste/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/teste/.settings/org.eclipse.core.resources.prefs b/teste/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..f9fe3459 --- /dev/null +++ b/teste/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/teste/.settings/org.eclipse.jdt.core.prefs b/teste/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..68c704e1 --- /dev/null +++ b/teste/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,101 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/teste/.settings/org.eclipse.jpt.core.prefs b/teste/.settings/org.eclipse.jpt.core.prefs new file mode 100644 index 00000000..24476ec2 --- /dev/null +++ b/teste/.settings/org.eclipse.jpt.core.prefs @@ -0,0 +1,259 @@ +eclipse.preferences.version=1 +org.eclipse.jpt.core.platform=hibernate2_1 +org.eclipse.jpt.jpa.core.discoverAnnotatedClasses=true +org.eclipse.jpt.jpa.core.metamodelSourceFolderName=src/main/java +problem.ASSOCIATION_OVERRIDE_INVALID_NAME=error +problem.ATTRIBUTE_OVERRIDE_DERIVED_AND_SPECIFIED=error +problem.ATTRIBUTE_OVERRIDE_INVALID_NAME=error +problem.ATTRIBUTE_OVERRIDE_INVALID_TYPE=error +problem.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=error +problem.COLLECTION_TABLE_UNRESOLVED_CATALOG=error +problem.COLLECTION_TABLE_UNRESOLVED_NAME=error +problem.COLLECTION_TABLE_UNRESOLVED_SCHEMA=error +problem.COLUMN_TABLE_NOT_VALID=error +problem.COLUMN_UNRESOLVED_NAME=error +problem.COLUMN_UNRESOLVED_TABLE=error +problem.DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=error +problem.ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING=error +problem.ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING=error +problem.ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST=error +problem.ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=error +problem.ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=error +problem.EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC=error +problem.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE=error +problem.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR=error +problem.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE=error +problem.EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS=error +problem.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED=error +problem.ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED=warning +problem.ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE=error +problem.ENTITY_NAME_DUPLICATED=error +problem.ENTITY_NAME_MISSING=error +problem.ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED=error +problem.ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED=error +problem.ENTITY_NON_ROOT_ID_CLASS_SPECIFIED=error +problem.ENTITY_NO_PK=error +problem.ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE=error +problem.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED=error +problem.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED=warning +problem.ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM=warning +problem.ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM=error +problem.GENERATOR_DUPLICATE_NAME=error +problem.GENERATOR_NAME_UNDEFINED=error +problem.ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED=error +problem.INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.JOIN_COLUMN_TABLE_NOT_VALID=error +problem.JOIN_COLUMN_UNRESOLVED_NAME=error +problem.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.JOIN_TABLE_UNRESOLVED_CATALOG=error +problem.JOIN_TABLE_UNRESOLVED_NAME=error +problem.JOIN_TABLE_UNRESOLVED_SCHEMA=error +problem.JPQL_QUERY_VALIDATION=error +problem.MANAGED_TYPE_UNRESOLVED_CLASS=error +problem.MANAGED_TYPE_UNSPECIFIED_CLASS=error +problem.MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_METADATA=warning +problem.MAPPING_INVALID_MAPPED_BY=error +problem.MAPPING_MAPPED_BY_ON_BOTH_SIDES=error +problem.MAPPING_UNRESOLVED_MAPPED_BY=error +problem.MAPS_ID_VALUE_INVALID=error +problem.MAPS_ID_VALUE_NOT_RESOLVED=error +problem.MAPS_ID_VALUE_NOT_SPECIFIED=error +problem.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=error +problem.MAP_KEY_CLASS_NOT_DEFINED=error +problem.MAP_KEY_CLASS_NOT_EXIST=error +problem.MAP_KEY_COLUMN_TABLE_NOT_VALID=error +problem.MAP_KEY_COLUMN_UNRESOLVED_NAME=error +problem.MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.NO_JPA_PROJECT=error +problem.ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED=error +problem.ORDER_COLUMN_UNRESOLVED_NAME=error +problem.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS=warning +problem.PERSISTENCE_NO_PERSISTENCE_UNIT=error +problem.PERSISTENCE_UNIT_DUPLICATE_CLASS=error +problem.PERSISTENCE_UNIT_DUPLICATE_JAR_FILE=error +problem.PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE=error +problem.PERSISTENCE_UNIT_INVALID_CLASS=error +problem.PERSISTENCE_UNIT_INVALID_MAPPING_FILE=error +problem.PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING=warning +problem.PERSISTENCE_UNIT_LISTED_CLASS_IS_AN_ENUM=error +problem.PERSISTENCE_UNIT_LISTED_CLASS_IS_AN_INTERFACE=error +problem.PERSISTENCE_UNIT_NONEXISTENT_CLASS=error +problem.PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE=error +problem.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE=error +problem.PERSISTENCE_UNIT_REDUNDANT_CLASS=info +problem.PERSISTENCE_UNIT_UNSPECIFIED_CLASS=error +problem.PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE=error +problem.PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE=error +problem.PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT=error +problem.PERSISTENCE_XML_INVALID_CONTENT=error +problem.PERSISTENCE_XML_UNSUPPORTED_CONTENT=error +problem.PERSISTENT_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE=error +problem.PERSISTENT_ATTRIBUTE_FINAL_FIELD=error +problem.PERSISTENT_ATTRIBUTE_FINAL_GETTER=error +problem.PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED=warning +problem.PERSISTENT_ATTRIBUTE_INVALID_MAPPING=error +problem.PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE=error +problem.PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE=error +problem.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE=warning +problem.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD=error +problem.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=error +problem.PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=error +problem.PERSISTENT_TYPE_DUPLICATE_CLASS=warning +problem.PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.PROJECT_INACTIVE_CONNECTION=warning +problem.PROJECT_INVALID_CONNECTION=warning +problem.PROJECT_INVALID_LIBRARY_PROVIDER=error +problem.PROJECT_MULTIPLE_PERSISTENCE_XML=error +problem.PROJECT_NO_CONNECTION=warning +problem.PROJECT_NO_PERSISTENCE_XML=error +problem.QUERY_DUPLICATE_NAME=error +problem.QUERY_NAME_UNDEFINED=error +problem.QUERY_STATEMENT_UNDEFINED=error +problem.ROOT_ENTITY_HAS_PK_JOIN_COLUMN_DEFINED=error +problem.SECONDARY_TABLE_UNRESOLVED_CATALOG=error +problem.SECONDARY_TABLE_UNRESOLVED_NAME=error +problem.SECONDARY_TABLE_UNRESOLVED_SCHEMA=error +problem.TABLE_UNRESOLVED_CATALOG=error +problem.TABLE_UNRESOLVED_NAME=error +problem.TABLE_UNRESOLVED_SCHEMA=error +problem.TARGET_ENTITY_IS_NOT_AN_ENTITY=error +problem.TARGET_ENTITY_NOT_DEFINED=error +problem.TARGET_ENTITY_NOT_EXIST=error +problem.TARGET_NOT_AN_EMBEDDABLE=error +problem.TYPE_ANNOTATED_BUT_NOT_LISTED_IN_PERSISTENCE_XML=warning +problem.TYPE_MANAGED_BUT_NOT_LISTED_IN_PERSISTENCE_XML=error +problem.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR=error +problem.TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR=error +problem.TYPE_MAPPING_FINAL_CLASS=error +problem.TYPE_MAPPING_ID_AND_EMBEDDED_ID_BOTH_USED=error +problem.TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED=error +problem.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_DOES_NOT_EXIST=error +problem.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH=error +problem.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH=error +problem.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY=error +problem.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH=error +problem.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE=error +problem.TYPE_MAPPING_ID_CLASS_MISSING_EQUALS_METHOD=error +problem.TYPE_MAPPING_ID_CLASS_MISSING_HASHCODE_METHOD=error +problem.TYPE_MAPPING_ID_CLASS_MISSING_NO_ARG_CONSTRUCTOR=error +problem.TYPE_MAPPING_ID_CLASS_MISSING_PUBLIC_NO_ARG_CONSTRUCTOR=error +problem.TYPE_MAPPING_ID_CLASS_NAME_EMPTY=error +problem.TYPE_MAPPING_ID_CLASS_NOT_EXIST=error +problem.TYPE_MAPPING_ID_CLASS_NOT_IMPLEMENT_SERIALIZABLE=error +problem.TYPE_MAPPING_ID_CLASS_NOT_PUBLIC=error +problem.TYPE_MAPPING_ID_CLASS_PROPERTY_METHOD_NOT_PUBLIC=error +problem.TYPE_MAPPING_ID_CLASS_REDEFINED=error +problem.TYPE_MAPPING_ID_CLASS_REQUIRED=error +problem.TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID=error +problem.TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE=error +problem.TYPE_MAPPING_MEMBER_CLASS=error +problem.TYPE_MAPPING_MULTIPLE_EMBEDDED_ID=error +problem.TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE=error +problem.TYPE_MAPPING_PK_REDEFINED_ID_CLASS=error +problem.UNRESOLVED_GENERATOR_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_CATALOG=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_NAME=error +problem.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_SCHEMA=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME=error +problem.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=error +problem.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG=error +problem.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA=error +problem.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING=error +problem.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING=error +problem.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE=error +problem.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST=error +problem.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=error +problem.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=error +problem.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC=error +problem.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE=error +problem.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR=error +problem.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE=error +problem.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS=error +problem.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED=error +problem.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE=error +problem.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE=error +problem.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG=error +problem.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME=error +problem.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY=error +problem.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED=error +problem.VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE=error +problem.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=error +problem.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=error +problem.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=error +problem.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=error +problem.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=error +problem.XML_VERSION_NOT_LATEST=info +workspace_validation_preferences_overridden=true diff --git a/teste/.settings/org.eclipse.m2e.core.prefs b/teste/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/teste/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/teste/.settings/org.eclipse.wst.common.component b/teste/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..927b734a --- /dev/null +++ b/teste/.settings/org.eclipse.wst.common.component @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/teste/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/teste/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 00000000..d9d9fb44 --- /dev/null +++ b/teste/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/teste/.settings/org.eclipse.wst.common.project.facet.core.xml b/teste/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..a3818a98 --- /dev/null +++ b/teste/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/teste/.settings/org.eclipse.wst.jsdt.ui.superType.container b/teste/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 00000000..3bd5d0a4 --- /dev/null +++ b/teste/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/teste/.settings/org.eclipse.wst.jsdt.ui.superType.name b/teste/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 00000000..05bd71b6 --- /dev/null +++ b/teste/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/teste/.settings/org.eclipse.wst.validation.prefs b/teste/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 00000000..04cad8cb --- /dev/null +++ b/teste/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,2 @@ +disabled=06target +eclipse.preferences.version=1 diff --git a/teste/.settings/org.hibernate.eclipse.console.prefs b/teste/.settings/org.hibernate.eclipse.console.prefs new file mode 100644 index 00000000..9f427fbb --- /dev/null +++ b/teste/.settings/org.hibernate.eclipse.console.prefs @@ -0,0 +1,3 @@ +default.configuration=teste +eclipse.preferences.version=1 +hibernate3.enabled=true diff --git a/teste/.tern-project b/teste/.tern-project new file mode 100644 index 00000000..f030bd16 --- /dev/null +++ b/teste/.tern-project @@ -0,0 +1,17 @@ +{ + "plugins": { + "guess-types": { + + }, + "outline": { + + }, + "angular": { + + } + }, + "libs": [ + "ecma5", + "browser" + ] +} \ No newline at end of file diff --git a/teste/bower.json b/teste/bower.json new file mode 100644 index 00000000..e66c6ca0 --- /dev/null +++ b/teste/bower.json @@ -0,0 +1,22 @@ +{ + "name": "teste", + "homepage": "https://github.com/marcioowc/test", + "authors": [ + "Marcio Wallace Cavalcanti " + ], + "description": "", + "main": "", + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "src/main/webapp/js/lib", + "test", + "tests" + ], + "dependencies": { + "angular": "^1.5.8", + "bootstrap": "^3.3.7" + } +} diff --git a/teste/pom.xml b/teste/pom.xml new file mode 100644 index 00000000..6bf1256e --- /dev/null +++ b/teste/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + + src.main.java + teste + 0.0.1-SNAPSHOT + war + + + UTF-8 + 1.7 + 7.0 + + + + + maven2-repository.java.net + Java.net Repository for Maven + http://download.java.net/maven/2/ + default + + + + teste + + + maven-compiler-plugin + 2.3.2 + + ${java.version} + ${java.version} + + + + + + + + org.hibernate + hibernate-validator + 5.2.4.Final + + + org.hibernate + hibernate-entitymanager + 4.1.9.Final + + + mysql + mysql-connector-java + 5.1.6 + + + org.hibernate + hibernate-core + 4.1.9.Final + + + javax + javaee-api + 7.0 + provided + + + com.fasterxml.jackson.core + jackson-annotations + 2.8.3 + + + com.fasterxml.jackson.core + jackson-databind + 2.8.3 + + + junit + junit + 4.8.2 + test + + + org.jboss.resteasy + resteasy-jaxrs + 2.2.1.GA + + + + diff --git a/teste/src/main/java/META-INF/persistence.xml b/teste/src/main/java/META-INF/persistence.xml new file mode 100644 index 00000000..731b1873 --- /dev/null +++ b/teste/src/main/java/META-INF/persistence.xml @@ -0,0 +1,30 @@ + + + + org.hibernate.ejb.HibernatePersistence + com.contabilizei.teste.customer.model.Customer + com.contabilizei.teste.order.model.Order + com.contabilizei.teste.orderitem.model.OrderItem + com.contabilizei.teste.product.model.Product + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/teste/src/main/java/com/contabilizei/teste/Test.java b/teste/src/main/java/com/contabilizei/teste/Test.java new file mode 100644 index 00000000..d9ccceda --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/Test.java @@ -0,0 +1,59 @@ +package com.contabilizei.teste; + +import java.util.List; + +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.ordercontroller.OrderController; + + +public class Test { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + /*CustomerController controller = new CustomerController(); + List customer = controller.findAll(); + + System.out.println(customer.size());*/ + + /*ProductController controller = new ProductController(); + List product = controller.findAll(); + + System.out.println(product);*/ + + OrderController controller = new OrderController(); + List order = controller.findAll(); + + System.out.println(order); + + /*EntityManagerFactory emf = Persistence.createEntityManagerFactory("Cliente"); + + EntityManager em = emf.createEntityManager(); + EntityTransaction tx = em.getTransaction(); + tx.begin(); + + Cliente cliente = new Cliente(); + cliente.setName("ZICA"); + cliente.setIdFederac(1111111111); + em.persist(cliente); + + tx.commit(); + em.close(); + emf.close();*/ + + /*EntityManagerFactory emf = Persistence.createEntityManagerFactory("Customer"); + EntityManager em = emf.createEntityManager(); + EntityTransaction tx = em.getTransaction(); + tx.begin(); + + Customer customer = new Customer(); + customer.setName("Cliente 3"); + customer.setIdFederac(00011111111); + em.persist(customer); + + tx.commit(); + em.close();*/ + + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/customer/controller/CustomerController.java b/teste/src/main/java/com/contabilizei/teste/customer/controller/CustomerController.java new file mode 100644 index 00000000..0f1673ee --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/customer/controller/CustomerController.java @@ -0,0 +1,33 @@ +package com.contabilizei.teste.customer.controller; + +import java.util.List; + +import com.contabilizei.teste.customer.dao.CustomerDAO; +import com.contabilizei.teste.customer.dao.persistence.CustomerDAOPersistence; +import com.contabilizei.teste.customer.model.Customer; + +public class CustomerController { + + CustomerDAO dao = new CustomerDAOPersistence(Customer.class); + + public Customer findById(Integer id){ + return dao.findById(id); + } + + public List findAll(){ + return dao.findAll(); + } + + public void create(Customer customer){ + this.dao.create(customer); + } + + public Customer update(Customer customer){ + return dao.update(customer); + } + + public void delete(Integer id){ + this.dao.delete(id); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/customer/dao/CustomerDAO.java b/teste/src/main/java/com/contabilizei/teste/customer/dao/CustomerDAO.java new file mode 100644 index 00000000..be7d6581 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/customer/dao/CustomerDAO.java @@ -0,0 +1,25 @@ +package com.contabilizei.teste.customer.dao; + +import java.util.List; + +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.services.CRUDService; + +public interface CustomerDAO extends CRUDService{ + + @Override + public abstract void create(Customer e); + + @Override + public abstract Customer findById(Integer id); + + @Override + public abstract List findAll(); + + @Override + public abstract Customer update(Customer e); + + @Override + public abstract void delete(Integer id); + +} diff --git a/teste/src/main/java/com/contabilizei/teste/customer/dao/persistence/CustomerDAOPersistence.java b/teste/src/main/java/com/contabilizei/teste/customer/dao/persistence/CustomerDAOPersistence.java new file mode 100644 index 00000000..6b6df460 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/customer/dao/persistence/CustomerDAOPersistence.java @@ -0,0 +1,53 @@ +package com.contabilizei.teste.customer.dao.persistence; + +import java.util.List; + +import javax.annotation.PostConstruct; + +import com.contabilizei.teste.customer.dao.CustomerDAO; +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.services.impl.CRUDServiceImpl; + +public class CustomerDAOPersistence extends CRUDServiceImpl implements CustomerDAO { + + public CustomerDAOPersistence(Class className) { + super(className); + } + + @Override + @PostConstruct + public void init() { + this.entityClass = Customer.class; + } + + @Override + public Customer findById(Integer id) { + return super.findById(id); + } + + @Override + public List findAll() { + return super.findAll(); + } + + @Override + public void create(Customer e) { + super.create(e); + } + + @Override + public Customer update(Customer e) { + return super.update(e); + } + + @Override + public void delete(Integer id) { + super.delete(id); + } + + @Override + public Customer findForDelete(Integer id) { + return super.findForDelete(id); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/customer/model/Customer.java b/teste/src/main/java/com/contabilizei/teste/customer/model/Customer.java new file mode 100644 index 00000000..eadcf3b9 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/customer/model/Customer.java @@ -0,0 +1,95 @@ +package com.contabilizei.teste.customer.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="cliente") +public class Customer implements Serializable{ + + private static final long serialVersionUID = 1L; + + @Id + @Column(name="id",unique=true,nullable=false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name="nome") + private String name; + + @Column(name="id_federac") + private String idFederac; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIdFederac() { + return idFederac; + } + + public void setIdFederac(String idFederac) { + this.idFederac = idFederac; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((idFederac == null) ? 0 : idFederac.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Customer other = (Customer) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + if (idFederac == null) { + if (other.idFederac != null) + return false; + } else if (!idFederac.equals(other.idFederac)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } + + @Override + public String toString() { + return "Customer [id=" + id + ", name=" + name + ", idFederac=" + idFederac + "]"; + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/customer/model/Customer_.java b/teste/src/main/java/com/contabilizei/teste/customer/model/Customer_.java new file mode 100644 index 00000000..2af72b2e --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/customer/model/Customer_.java @@ -0,0 +1,13 @@ +package com.contabilizei.teste.customer.model; + +import javax.annotation.Generated; +import javax.persistence.metamodel.SingularAttribute; +import javax.persistence.metamodel.StaticMetamodel; + +@Generated(value="Dali", date="2016-09-26T23:12:51.218-0300") +@StaticMetamodel(Customer.class) +public class Customer_ { + public static volatile SingularAttribute id; + public static volatile SingularAttribute name; + public static volatile SingularAttribute idFederac; +} diff --git a/teste/src/main/java/com/contabilizei/teste/customer/rest/CustomerRest.java b/teste/src/main/java/com/contabilizei/teste/customer/rest/CustomerRest.java new file mode 100644 index 00000000..3b96bd2a --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/customer/rest/CustomerRest.java @@ -0,0 +1,61 @@ +package com.contabilizei.teste.customer.rest; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import com.contabilizei.teste.customer.controller.CustomerController; +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.rest.AbstractRest; + +@Path("/customers") +public class CustomerRest extends AbstractRest{ + + private CustomerController controller = new CustomerController(); + + @GET + @Path("/getCustomer/{customer}") + @Produces(MediaType.APPLICATION_JSON) + public Response getCustomer(@PathParam("customer") Integer id ){ + return buildResponse(this.controller.findById(id)); + } + + @GET + @Path("/getAllCustomers") + @Produces(MediaType.APPLICATION_JSON) + public Response getAllCustomers(){ + return buildResponse(this.controller.findAll()); + } + + @POST + @Produces(MediaType.TEXT_PLAIN) + @Consumes(MediaType.APPLICATION_JSON) + public Response save(Customer customer){ + this.controller.create(customer); + return buildResponse("Contato salvo com sucesso"); + } + + @PUT + @Produces(MediaType.TEXT_PLAIN) + @Consumes(MediaType.APPLICATION_JSON) + public Response update(Customer customer){ + Customer customerReturn = this.controller.update(customer); + return buildResponse(customerReturn.getName() + " atualizado!"); + } + + @DELETE + @Path("/deleteCustomer/{id}") + public Response delete (@PathParam("id") int id){ + this.controller.delete(id); + return buildResponse("Cliente Excluido"); + + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/order/dao/OrderDAO.java b/teste/src/main/java/com/contabilizei/teste/order/dao/OrderDAO.java new file mode 100644 index 00000000..155465f3 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/order/dao/OrderDAO.java @@ -0,0 +1,25 @@ +package com.contabilizei.teste.order.dao; + +import java.util.List; + +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.services.CRUDService; + +public interface OrderDAO extends CRUDService{ + + @Override + public abstract void create(Order e); + + @Override + public abstract Order findById(Integer id); + + @Override + public abstract List findAll(); + + @Override + public abstract Order update(Order e); + + @Override + public abstract void delete(Integer id); + +} diff --git a/teste/src/main/java/com/contabilizei/teste/order/dao/persistence/OrderDAOPersistence.java b/teste/src/main/java/com/contabilizei/teste/order/dao/persistence/OrderDAOPersistence.java new file mode 100644 index 00000000..02564b08 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/order/dao/persistence/OrderDAOPersistence.java @@ -0,0 +1,48 @@ +package com.contabilizei.teste.order.dao.persistence; + +import java.util.List; + +import javax.annotation.PostConstruct; + +import com.contabilizei.teste.order.dao.OrderDAO; +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.services.impl.CRUDServiceImpl; + +public class OrderDAOPersistence extends CRUDServiceImpl implements OrderDAO { + + public OrderDAOPersistence(Class className) { + super(className); + } + + @Override + @PostConstruct + public void init() { + this.entityClass = Order.class; + } + + @Override + public Order findById(Integer id) { + return super.findById(id); + } + + @Override + public List findAll() { + return super.findAll(); + } + + @Override + public void create(Order e) { + super.create(e); + } + + @Override + public Order update(Order e) { + return super.update(e); + } + + @Override + public void delete(Integer id) { + super.delete(id); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/order/model/Order.java b/teste/src/main/java/com/contabilizei/teste/order/model/Order.java new file mode 100644 index 00000000..9bdeb332 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/order/model/Order.java @@ -0,0 +1,154 @@ +package com.contabilizei.teste.order.model; + +import java.io.Serializable; +import java.util.Date; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.orderitem.model.OrderItem; +import com.fasterxml.jackson.annotation.JsonManagedReference; + +@Entity +@Table(name="pedido") +public class Order implements Serializable{ + + private static final long serialVersionUID = 1L; + + @Id + @Column(name="id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name="id_cliente") + private Integer customerId; + + @Column(name="dat_emissao") + private Date date; + + @OneToOne + @JoinColumn(name="id_cliente",referencedColumnName="id",nullable=true,insertable=false,updatable=false) + private Customer customer; + + @Column(name="total") + private Double amount; + + @JsonManagedReference + @OneToMany(fetch=FetchType.LAZY, mappedBy="order", cascade=CascadeType.ALL) + private Set orderItem; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getCustomerId() { + return customerId; + } + + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } + + public Customer getCustomer() { + return customer; + } + + public void setCustomer(Customer customer) { + this.customer = customer; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public Set getOrderItem() { + return orderItem; + } + + public void setOrderItem(Set orderItem) { + this.orderItem = orderItem; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((amount == null) ? 0 : amount.hashCode()); + result = prime * result + ((customer == null) ? 0 : customer.hashCode()); + result = prime * result + ((customerId == null) ? 0 : customerId.hashCode()); + result = prime * result + ((date == null) ? 0 : date.hashCode()); + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Order other = (Order) obj; + if (amount == null) { + if (other.amount != null) + return false; + } else if (!amount.equals(other.amount)) + return false; + if (customer == null) { + if (other.customer != null) + return false; + } else if (!customer.equals(other.customer)) + return false; + if (customerId == null) { + if (other.customerId != null) + return false; + } else if (!customerId.equals(other.customerId)) + return false; + if (date == null) { + if (other.date != null) + return false; + } else if (!date.equals(other.date)) + return false; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + @Override + public String toString() { + return "Order [id=" + id + ", customerId=" + customerId + ", date=" + date + ", customer=" + customer + + ", amount=" + amount + ", orderItem=" + orderItem + "]"; + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/order/model/Order_.java b/teste/src/main/java/com/contabilizei/teste/order/model/Order_.java new file mode 100644 index 00000000..4918b3a9 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/order/model/Order_.java @@ -0,0 +1,20 @@ +package com.contabilizei.teste.order.model; + +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.orderitem.model.OrderItem; +import java.util.Date; +import javax.annotation.Generated; +import javax.persistence.metamodel.SetAttribute; +import javax.persistence.metamodel.SingularAttribute; +import javax.persistence.metamodel.StaticMetamodel; + +@Generated(value="Dali", date="2016-09-30T08:00:14.182-0300") +@StaticMetamodel(Order.class) +public class Order_ { + public static volatile SingularAttribute id; + public static volatile SingularAttribute customerId; + public static volatile SingularAttribute date; + public static volatile SingularAttribute customer; + public static volatile SingularAttribute amount; + public static volatile SetAttribute orderItem; +} diff --git a/teste/src/main/java/com/contabilizei/teste/order/rest/OrderRest.java b/teste/src/main/java/com/contabilizei/teste/order/rest/OrderRest.java new file mode 100644 index 00000000..6a90562b --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/order/rest/OrderRest.java @@ -0,0 +1,70 @@ +package com.contabilizei.teste.order.rest; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.ordercontroller.OrderController; +import com.contabilizei.teste.orderitem.controller.OrderItemController; +import com.contabilizei.teste.rest.AbstractRest; + +@Path("/orders") +public class OrderRest extends AbstractRest { + + private OrderController controller = new OrderController(); + private OrderItemController controllerItem = new OrderItemController(); + + @GET + @Path("/getOrder/{order}") + @Produces(MediaType.APPLICATION_JSON) + public Response getOrder(@PathParam("order") Integer id ){ + return buildResponse(this.controller.findById(id)); + } + + @GET + @Path("/getAllOrders") + @Produces(MediaType.APPLICATION_JSON) + public Response getAllOrders(){ + return buildResponse(this.controller.findAll()); + } + + @POST + @Consumes(MediaType.APPLICATION_JSON) + public Response save(Order order){ + this.controller.create(order); + return Response.ok("Contato salvo com sucesso").type(MediaType.TEXT_PLAIN).build(); + } + + @PUT + @Produces(MediaType.TEXT_PLAIN) + @Consumes(MediaType.APPLICATION_JSON) + public Response update(Order order){ + Order orderReturn = this.controller.update(order); + return Response.ok(orderReturn.getId().toString() + " atualizado!").build(); + } + + @DELETE + @Path("/deleteOrder/{id}") + public Response delete (@PathParam("id") int id){ + this.controller.delete(id); + return Response.ok("Cliente Excluido").build(); + + } + + @DELETE + @Path("/deleteItemOrder/{orderId}/{productId}") + public Response deleteItemOrder (@PathParam("orderId") int orderId, @PathParam("productId") int productId){ + this.controllerItem.deleteItemOrder(orderId, productId); + return Response.ok("Cliente Excluido").build(); + + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/ordercontroller/OrderController.java b/teste/src/main/java/com/contabilizei/teste/ordercontroller/OrderController.java new file mode 100644 index 00000000..8fb21369 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/ordercontroller/OrderController.java @@ -0,0 +1,33 @@ +package com.contabilizei.teste.ordercontroller; + +import java.util.List; + +import com.contabilizei.teste.order.dao.OrderDAO; +import com.contabilizei.teste.order.dao.persistence.OrderDAOPersistence; +import com.contabilizei.teste.order.model.Order; + +public class OrderController { + + OrderDAO dao = new OrderDAOPersistence(Order.class); + + public Order findById(Integer id){ + return dao.findById(id); + } + + public List findAll(){ + return dao.findAll(); + } + + public void create(Order order){ + this.dao.create(order); + } + + public Order update(Order order){ + return dao.update(order); + } + + public void delete(Integer id){ + this.dao.delete(id); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/orderitem/controller/OrderItemController.java b/teste/src/main/java/com/contabilizei/teste/orderitem/controller/OrderItemController.java new file mode 100644 index 00000000..2a54d5ec --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/orderitem/controller/OrderItemController.java @@ -0,0 +1,18 @@ +package com.contabilizei.teste.orderitem.controller; + +import com.contabilizei.teste.order.dao.OrderDAO; +import com.contabilizei.teste.order.dao.persistence.OrderDAOPersistence; +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.orderitem.dao.OrderItemDAO; +import com.contabilizei.teste.orderitem.dao.persistence.OrderItemDAOPersistence; + +public class OrderItemController { + + OrderDAO dao = new OrderDAOPersistence(Order.class); + OrderItemDAO daoItem = new OrderItemDAOPersistence(OrderItemDAOPersistence.class); + + public void deleteItemOrder(Integer orderId, Integer productId){ + this. daoItem.deleteItem(orderId, productId); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/orderitem/dao/OrderItemDAO.java b/teste/src/main/java/com/contabilizei/teste/orderitem/dao/OrderItemDAO.java new file mode 100644 index 00000000..e37fa7e6 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/orderitem/dao/OrderItemDAO.java @@ -0,0 +1,14 @@ +package com.contabilizei.teste.orderitem.dao; + +import java.util.List; + +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.orderitem.model.OrderItem; +import com.contabilizei.teste.services.CRUDService; + +public interface OrderItemDAO extends CRUDService{ + + + public abstract void deleteItem(Integer orderId, Integer productId); + +} diff --git a/teste/src/main/java/com/contabilizei/teste/orderitem/dao/persistence/OrderItemDAOPersistence.java b/teste/src/main/java/com/contabilizei/teste/orderitem/dao/persistence/OrderItemDAOPersistence.java new file mode 100644 index 00000000..0aaff450 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/orderitem/dao/persistence/OrderItemDAOPersistence.java @@ -0,0 +1,49 @@ +package com.contabilizei.teste.orderitem.dao.persistence; + +import javax.annotation.PostConstruct; +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; + +import com.contabilizei.teste.orderitem.dao.OrderItemDAO; +import com.contabilizei.teste.orderitem.model.OrderItem; +import com.contabilizei.teste.orderitem.model.OrderItemPK; +import com.contabilizei.teste.orderitem.model.OrderItem_; +import com.contabilizei.teste.services.impl.CRUDServiceImpl; + +public class OrderItemDAOPersistence extends CRUDServiceImpl implements OrderItemDAO{ + + public OrderItemDAOPersistence(Class className) { + super(className); + } + + @Override + @PostConstruct + public void init() { + this.entityClass = OrderItem.class; + } + + @Override + public void deleteItem(Integer orderId, Integer productId) { + + CriteriaBuilder cb = super.em.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(OrderItem.class); + Root root = cq.from(OrderItem.class); + Predicate predicate = cb.equal(root.get(OrderItem_.orderId), orderId); + predicate = cb.and(predicate,cb.equal(root.get(OrderItem_.product), productId)); + cq.where(predicate); + TypedQuery query = em.createQuery(cq); + + try{ + super.tx.begin(); + super.em.find(OrderItem.class, new OrderItemPK(orderId, productId)); + super.em.remove(query.getSingleResult()); + super.tx.commit(); + }finally{ + super.em.close(); + } + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItem.java b/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItem.java new file mode 100644 index 00000000..a357c8e4 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItem.java @@ -0,0 +1,150 @@ +package com.contabilizei.teste.orderitem.model; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.product.model.Product; +import com.fasterxml.jackson.annotation.JsonBackReference; + +@Entity +@Table(name="item_pedido") +@IdClass(OrderItemPK.class) +public class OrderItem{ + + + @Id + @Column(name="id_pedido") + private Integer orderId; + + @Id + @Column(name="id_produto") + private Integer productId; + + @JsonBackReference + @ManyToOne(fetch=FetchType.LAZY) + @JoinColumn(name="id_pedido",insertable=false,updatable=false) + private Order order; + + @ManyToOne + @JoinColumn(name="id_produto",insertable=false,updatable=false) + private Product product; + + @Column(name="quantidade") + private Double quantity; + + public OrderItem() { + super(); + } + + public OrderItem(Integer orderId, Integer productId, Order order, Product product, Double quantity) { + super(); + this.orderId = orderId; + this.productId = productId; + this.order = order; + this.product = product; + this.quantity = quantity; + } + + public Integer getOrderId() { + return orderId; + } + + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + + public Integer getProductId() { + return productId; + } + + public void setProductId(Integer productId) { + this.productId = productId; + } + + public Order getOrder() { + return order; + } + + public void setOrder(Order order) { + this.order = order; + } + + public Product getProduct() { + return product; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Double getQuantity() { + return quantity; + } + + public void setQuantity(Double quantity) { + this.quantity = quantity; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((order == null) ? 0 : order.hashCode()); + result = prime * result + ((orderId == null) ? 0 : orderId.hashCode()); + result = prime * result + ((product == null) ? 0 : product.hashCode()); + result = prime * result + ((productId == null) ? 0 : productId.hashCode()); + result = prime * result + ((quantity == null) ? 0 : quantity.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + OrderItem other = (OrderItem) obj; + if (order == null) { + if (other.order != null) + return false; + } else if (!order.equals(other.order)) + return false; + if (orderId == null) { + if (other.orderId != null) + return false; + } else if (!orderId.equals(other.orderId)) + return false; + if (product == null) { + if (other.product != null) + return false; + } else if (!product.equals(other.product)) + return false; + if (productId == null) { + if (other.productId != null) + return false; + } else if (!productId.equals(other.productId)) + return false; + if (quantity == null) { + if (other.quantity != null) + return false; + } else if (!quantity.equals(other.quantity)) + return false; + return true; + } + + @Override + public String toString() { + return "OrderItem [orderId=" + orderId + ", productId=" + productId + ", quantity=" + quantity + "]"; + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItemPK.java b/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItemPK.java new file mode 100644 index 00000000..327ebde6 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItemPK.java @@ -0,0 +1,68 @@ +package com.contabilizei.teste.orderitem.model; + +import java.io.Serializable; + +public class OrderItemPK implements Serializable{ + + private static final long serialVersionUID = 1L; + + private Integer orderId; + private Integer productId; + + + public OrderItemPK() { + super(); + // TODO Auto-generated constructor stub + } + public OrderItemPK(Integer orderId, Integer productId) { + super(); + this.orderId = orderId; + this.productId = productId; + } + public Integer getOrderId() { + return orderId; + } + public void setOrderId(Integer orderId) { + this.orderId = orderId; + } + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((orderId == null) ? 0 : orderId.hashCode()); + result = prime * result + ((productId == null) ? 0 : productId.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + OrderItemPK other = (OrderItemPK) obj; + if (orderId == null) { + if (other.orderId != null) + return false; + } else if (!orderId.equals(other.orderId)) + return false; + if (productId == null) { + if (other.productId != null) + return false; + } else if (!productId.equals(other.productId)) + return false; + return true; + } + @Override + public String toString() { + return "OrderItemPK [orderId=" + orderId + ", productId=" + productId + "]"; + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItem_.java b/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItem_.java new file mode 100644 index 00000000..36790bf8 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/orderitem/model/OrderItem_.java @@ -0,0 +1,17 @@ +package com.contabilizei.teste.orderitem.model; + +import com.contabilizei.teste.order.model.Order; +import com.contabilizei.teste.product.model.Product; +import javax.annotation.Generated; +import javax.persistence.metamodel.SingularAttribute; +import javax.persistence.metamodel.StaticMetamodel; + +@Generated(value="Dali", date="2016-09-30T08:00:14.199-0300") +@StaticMetamodel(OrderItem.class) +public class OrderItem_ { + public static volatile SingularAttribute orderId; + public static volatile SingularAttribute productId; + public static volatile SingularAttribute order; + public static volatile SingularAttribute product; + public static volatile SingularAttribute quantity; +} diff --git a/teste/src/main/java/com/contabilizei/teste/product/controller/ProductController.java b/teste/src/main/java/com/contabilizei/teste/product/controller/ProductController.java new file mode 100644 index 00000000..7702986d --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/product/controller/ProductController.java @@ -0,0 +1,34 @@ +package com.contabilizei.teste.product.controller; + +import java.util.List; + +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.product.dao.ProductDAO; +import com.contabilizei.teste.product.dao.persistence.ProductDAOPersistence; +import com.contabilizei.teste.product.model.Product; + +public class ProductController { + + ProductDAO dao = new ProductDAOPersistence(Product.class); + + public Product findById(Integer id){ + return dao.findById(id); + } + + public List findAll(){ + return dao.findAll(); + } + + public void create(Product customer){ + this.dao.create(customer); + } + + public Product update(Product customer){ + return dao.update(customer); + } + + public void delete(Integer id){ + this.dao.delete(id); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/product/dao/ProductDAO.java b/teste/src/main/java/com/contabilizei/teste/product/dao/ProductDAO.java new file mode 100644 index 00000000..0555936e --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/product/dao/ProductDAO.java @@ -0,0 +1,25 @@ +package com.contabilizei.teste.product.dao; + +import java.util.List; + +import com.contabilizei.teste.product.model.Product; +import com.contabilizei.teste.services.CRUDService; + +public interface ProductDAO extends CRUDService{ + + @Override + public abstract void create(Product e); + + @Override + public abstract Product findById(Integer id); + + @Override + public abstract List findAll(); + + @Override + public abstract Product update(Product e); + + @Override + public abstract void delete(Integer id); + +} diff --git a/teste/src/main/java/com/contabilizei/teste/product/dao/persistence/ProductDAOPersistence.java b/teste/src/main/java/com/contabilizei/teste/product/dao/persistence/ProductDAOPersistence.java new file mode 100644 index 00000000..be7facd7 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/product/dao/persistence/ProductDAOPersistence.java @@ -0,0 +1,54 @@ +package com.contabilizei.teste.product.dao.persistence; + +import java.util.List; + +import javax.annotation.PostConstruct; + +import com.contabilizei.teste.customer.model.Customer; +import com.contabilizei.teste.product.dao.ProductDAO; +import com.contabilizei.teste.product.model.Product; +import com.contabilizei.teste.services.impl.CRUDServiceImpl; + +public class ProductDAOPersistence extends CRUDServiceImpl implements ProductDAO { + + public ProductDAOPersistence(Class className) { + super(className); + } + + @Override + @PostConstruct + public void init() { + this.entityClass = Product.class; + } + + @Override + public Product findById(Integer id) { + return super.findById(id); + } + + @Override + public List findAll() { + return super.findAll(); + } + + @Override + public void create(Product e) { + super.create(e); + } + + @Override + public Product update(Product e) { + return super.update(e); + } + + @Override + public void delete(Integer id) { + super.delete(id); + } + + @Override + public Product findForDelete(Integer id) { + return super.findForDelete(id); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/product/model/Product.java b/teste/src/main/java/com/contabilizei/teste/product/model/Product.java new file mode 100644 index 00000000..1ec1e5df --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/product/model/Product.java @@ -0,0 +1,94 @@ +package com.contabilizei.teste.product.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="produto") +public class Product implements Serializable{ + + private static final long serialVersionUID = 1L; + + @Id + @Column(name="id",unique=true,nullable=false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name="nome") + private String name; + + @Column(name="val_unitario") + private Double price; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getPrice() { + return price; + } + + public void setPrice(Double price) { + this.price = price; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((price == null) ? 0 : price.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Product other = (Product) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (price == null) { + if (other.price != null) + return false; + } else if (!price.equals(other.price)) + return false; + return true; + } + + @Override + public String toString() { + return "Product [id=" + id + ", name=" + name + ", price=" + price + "]"; + } +} diff --git a/teste/src/main/java/com/contabilizei/teste/product/model/Product_.java b/teste/src/main/java/com/contabilizei/teste/product/model/Product_.java new file mode 100644 index 00000000..96d5d450 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/product/model/Product_.java @@ -0,0 +1,13 @@ +package com.contabilizei.teste.product.model; + +import javax.annotation.Generated; +import javax.persistence.metamodel.SingularAttribute; +import javax.persistence.metamodel.StaticMetamodel; + +@Generated(value="Dali", date="2016-09-28T14:37:00.422-0300") +@StaticMetamodel(Product.class) +public class Product_ { + public static volatile SingularAttribute id; + public static volatile SingularAttribute name; + public static volatile SingularAttribute price; +} diff --git a/teste/src/main/java/com/contabilizei/teste/product/rest/ProductRest.java b/teste/src/main/java/com/contabilizei/teste/product/rest/ProductRest.java new file mode 100644 index 00000000..cbecce6b --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/product/rest/ProductRest.java @@ -0,0 +1,60 @@ +package com.contabilizei.teste.product.rest; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import com.contabilizei.teste.product.controller.ProductController; +import com.contabilizei.teste.product.model.Product; +import com.contabilizei.teste.rest.AbstractRest; + +@Path("/products") +public class ProductRest extends AbstractRest{ + + private ProductController controller = new ProductController(); + + @GET + @Path("/getProduct/{product}") + @Produces(MediaType.APPLICATION_JSON) + public Response getProduct(@PathParam("product") Integer id ){ + return buildResponse(this.controller.findById(id)); + } + + @GET + @Path("/getAllProducts") + @Produces(MediaType.APPLICATION_JSON) + public Response getAllProduct(){ + return buildResponse(this.controller.findAll()); + } + + @POST + @Consumes(MediaType.APPLICATION_JSON) + public Response save(Product product){ + this.controller.create(product); + return Response.ok("Produto salvo com sucesso").type(MediaType.TEXT_PLAIN).build(); + } + + @PUT + @Produces(MediaType.TEXT_PLAIN) + @Consumes(MediaType.APPLICATION_JSON) + public Response update(Product product){ + Product productReturn = this.controller.update(product); + return Response.ok(productReturn.getName() + " atualizado!").build(); + } + + @DELETE + @Path("/deleteProduct/{id}") + public Response delete (@PathParam("id") int id){ + this.controller.delete(id); + return Response.ok("Cliente Excluido").build(); + + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/rest/AbstractRest.java b/teste/src/main/java/com/contabilizei/teste/rest/AbstractRest.java new file mode 100644 index 00000000..84927f99 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/rest/AbstractRest.java @@ -0,0 +1,28 @@ +package com.contabilizei.teste.rest; + +import javax.ws.rs.core.Response; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public abstract class AbstractRest { + + protected ObjectMapper getObjectMapper() { + return new ObjectMapper(); + } + + protected Response buildResponse(Object o) { + + try { + String json = getObjectMapper().writeValueAsString(new RestResponse(o)); + return Response.ok(json).build(); + } catch (JsonProcessingException e) { + e.printStackTrace(); + return buildErrorResponse(e); + } + } + + protected Response buildErrorResponse(Throwable e) { + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); + } +} diff --git a/teste/src/main/java/com/contabilizei/teste/rest/DefaultMessageBodyReader.java b/teste/src/main/java/com/contabilizei/teste/rest/DefaultMessageBodyReader.java new file mode 100644 index 00000000..c615a3c8 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/rest/DefaultMessageBodyReader.java @@ -0,0 +1,31 @@ +package com.contabilizei.teste.rest; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.ext.MessageBodyReader; +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@Provider +public class DefaultMessageBodyReader implements MessageBodyReader { + + @Override + public boolean isReadable(Class arg0, Type arg1, Annotation[] arg2, MediaType arg3) { + return true; + } + + @Override + public Object readFrom(Class arg0, Type arg1, Annotation[] arg2, MediaType arg3, + MultivaluedMap arg4, InputStream arg5) throws IOException, WebApplicationException { + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(arg5, arg0); + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/rest/RestResponse.java b/teste/src/main/java/com/contabilizei/teste/rest/RestResponse.java new file mode 100644 index 00000000..0239fcf5 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/rest/RestResponse.java @@ -0,0 +1,20 @@ +package com.contabilizei.teste.rest; + +public class RestResponse { + + private Object data; + + public RestResponse(Object data) { + super(); + this.data = data; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + +} diff --git a/teste/src/main/java/com/contabilizei/teste/rest/Root.java b/teste/src/main/java/com/contabilizei/teste/rest/Root.java new file mode 100644 index 00000000..22b85fe8 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/rest/Root.java @@ -0,0 +1,9 @@ +package com.contabilizei.teste.rest; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/rest") +public class Root extends Application { + +} \ No newline at end of file diff --git a/teste/src/main/java/com/contabilizei/teste/services/CRUDService.java b/teste/src/main/java/com/contabilizei/teste/services/CRUDService.java new file mode 100644 index 00000000..99af788b --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/services/CRUDService.java @@ -0,0 +1,19 @@ +package com.contabilizei.teste.services; + +import java.util.List; + +public interface CRUDService { + + void create(E e); + + E update(E e); + + void delete(ID id); + + E findById(ID id); + + List findAll(); + + E findForDelete(ID id); + +} diff --git a/teste/src/main/java/com/contabilizei/teste/services/impl/CRUDServiceImpl.java b/teste/src/main/java/com/contabilizei/teste/services/impl/CRUDServiceImpl.java new file mode 100644 index 00000000..6785db60 --- /dev/null +++ b/teste/src/main/java/com/contabilizei/teste/services/impl/CRUDServiceImpl.java @@ -0,0 +1,89 @@ +package com.contabilizei.teste.services.impl; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.EntityTransaction; +import javax.persistence.Persistence; +import javax.persistence.PersistenceContext; + +import com.contabilizei.teste.services.CRUDService; + +public abstract class CRUDServiceImpl implements CRUDService{ + + protected EntityManagerFactory emf; + protected EntityManager em; + protected Class entityClass; + protected EntityTransaction tx; + + public CRUDServiceImpl(Class className){ + this.emf = Persistence.createEntityManagerFactory("PersistenceUnit"); + this.em = emf.createEntityManager(); + this.tx = em.getTransaction(); + this.entityClass = className; + } + + public abstract void init(); + + @Override + public void create(E e) { + try{ + tx.begin(); + em.persist(e); + tx.commit(); + }finally{ + em.close(); + } + } + + @Override + public E update(E e) { + try{ + tx.begin(); + em.merge(e); + tx.commit(); + }finally{ + em.close(); + } + return e; + } + + @Override + public void delete(ID id) { + try{ + tx.begin(); + E e = findForDelete(id); + em.remove(e); + tx.commit(); + }finally{ + em.close(); + } + } + + @Override + public E findById(ID id) { + try{ + tx.begin(); + return em.find(entityClass, id); + }finally{ + em.close(); + } + } + + @Override + public List findAll() { + try{ + tx.begin(); + return em.createQuery("SELECT e FROM "+entityClass.getSimpleName()+" e").getResultList(); + }finally{ + em.close(); + } + } + + @Override + public E findForDelete(ID id) { + return em.find(entityClass, id); + } + +} diff --git a/teste/src/main/webapp/WEB-INF/beans.xml b/teste/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 00000000..29b61e1f --- /dev/null +++ b/teste/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,4 @@ + + diff --git a/teste/src/main/webapp/WEB-INF/web.xml b/teste/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..99c5c79a --- /dev/null +++ b/teste/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,33 @@ + + + Restful Web Application + + + resteasy.scan + true + + + + resteasy.servlet.mapping.prefix + /rest + + + + + org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap + + + resteasy-servlet + + org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher + + + + resteasy-servlet + /rest/* + + + \ No newline at end of file diff --git a/teste/src/main/webapp/config.rb b/teste/src/main/webapp/config.rb new file mode 100644 index 00000000..4302d097 --- /dev/null +++ b/teste/src/main/webapp/config.rb @@ -0,0 +1,25 @@ +# Require any additional compass plugins here. + +# Set this to the root of your project when deployed: +http_path = "/" +css_dir = "css" +sass_dir = "scss" +images_dir = "images" +javascripts_dir = "js" +fonts_dir = "fonts" + +output_style = :expanded + +# To enable relative paths to assets via compass helper functions. Uncomment: +# relative_assets = true + +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false +color_output = false + + +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass css scss && rm -rf sass && mv scss sass diff --git a/teste/src/main/webapp/css/normalize.css b/teste/src/main/webapp/css/normalize.css new file mode 100644 index 00000000..c7cc8288 --- /dev/null +++ b/teste/src/main/webapp/css/normalize.css @@ -0,0 +1 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} diff --git a/teste/src/main/webapp/css/style.css b/teste/src/main/webapp/css/style.css new file mode 100644 index 00000000..499ea476 --- /dev/null +++ b/teste/src/main/webapp/css/style.css @@ -0,0 +1,183 @@ +@import url(http://fonts.googleapis.com/css?family=Raleway:500); +body { + width: 100%; + margin: 0; + padding: 0; + overflow: hidden; + background: #f2f2f3; + font-family: 'Raleway', sans-serif; +} +body h1 { + text-align: center; + margin-top: 5%; + color: #333333; + letter-spacing: 1px; + text-shadow: 1px 1px #f2f2f3, -1px -1px #f2f2f3; +} + +.nav { + height: 100%; + position: fixed; + left: -2em; + top: 0; + z-index: 1000; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-perspective: 1000px; + perspective: 1000px; +} + +.icon { + position: absolute; + left: 0; + top: 0; + z-index: 990; + height: 100%; + background: #262626; +} +.icon li { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + list-style-type: none; +} +.icon a { + display: block; + width: 64px; + height: 64px; + line-height: 64px; + text-align: center; + font-size: 1.6em; + color: #999999; + text-shadow: 0 1px 0 black; + -webkit-transition: all .5s ease-out; + transition: all .5s ease-out; +} +.icon a:hover { + color: white; + -webkit-transform: translateX(10px) scale(1.2); + -ms-transform: translateX(10px) scale(1.2); + transform: translateX(10px) scale(1.2); +} + +.nav:hover .text { + -webkit-transform: rotateY(0deg); + transform: rotateY(0deg); +} + +.text { + position: absolute; + left: 63px; + top: 0; + z-index: 980; + height: 100%; + background: #262626; + border-right: 1px solid rgba(0, 0, 0, 0.3); + -webkit-transition: -webkit-transform .24s linear; + transition: transform .24s linear; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform-origin: left; + -ms-transform-origin: left; + transform-origin: left; + -webkit-transform: perspective(1000px) rotateY(90deg); + transform: perspective(1000px) rotateY(90deg); +} +.text li { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); +} +.text a { + display: block; + width: 200px; + height: 64px; + line-height: 64px; + text-indent: 1em; + font-size: 1.4em; + text-decoration: none; + color: #999999; + text-shadow: 0 1px 0 black; + -webkit-transition: all .5s ease; + transition: all .5s ease; +} +.text a:hover { + color: white; + -webkit-transform: translateX(-14px); + -ms-transform: translateX(-14px); + transform: translateX(-14px); +} + +.nav:hover .info { + left: 0; + opacity: 1; + -webkit-transition: opacity 0.5s ease-in 0.1s; + transition: opacity 0.5s ease-in 0.1s; +} + +.info { + position: absolute; + padding-left: 2em; + bottom: 30px; + z-index: 999; + width: 264px; + color: white; + text-align: center; + line-height: 1.6; + opacity: 0; +} +.info .logo p { + width: 100px; + height: 100px; + margin: 0 auto; + background: #262626; + color: #424242; + opacity: .6; + overflow: hidden; + text-align: center; + -webkit-transition: all .5s ease; + transition: all .5s ease; + font-size: 2em; + text-shadow: -1px -1px #4f4f4f, 1px 1px #121212; +} +.info .logo p:hover { + opacity: 1; + color: white; + text-shadow: -1px -1px #575757, 1px 1px #121212; +} +.info .name { + font-size: 2em; + font-weight: bold; + letter-spacing: 2px; + color: #424242; + text-shadow: -1px -1px #4f4f4f, 1px 1px #121212; +} +.info .quote { + color: #444; + text-shadow: 1px 1px #121212; +} +.info .social a { + font-size: 2em; + color: #333333; + letter-spacing: .5em; + text-shadow: 1px 1px #454545, -1px -1px #121212; + -webkit-transition: all .5s ease; + transition: all .5s ease; +} +.info .social a:hover { + color: white; + text-shadow: -1px -1px #575757, 1px 1px #121212; +} + +/* +Only added a nav query for height bc width is fine +(covers full width of viewport from 270px) down to 220px. +Bottom nav info section is hidden when screen height +hits 550px or below. Nav still functions as a fly-out +*/ +@media screen and (max-height: 550px) { + .info { + display: none; + } +} +@media screen and (max-width: 450px) { + h1 { + font-size: 7.5vw; + } +} diff --git a/teste/src/main/webapp/customer.html b/teste/src/main/webapp/customer.html new file mode 100644 index 00000000..c6fe589d --- /dev/null +++ b/teste/src/main/webapp/customer.html @@ -0,0 +1,103 @@ + + + + +Insert title here + + + + + + + + Clientes + +
+ + + + + + + + + + + + + +
IDCPF/CNPJNome
{{customer.id}}{{customer.idFederac}}{{customer.name}} + Delete + Edit +
+
+
+
+
+ Informações do Cliente +
+ + + +
+ + + + +
+ + + + + +
+
+
+
+
+ +
+ + + + \ No newline at end of file diff --git a/teste/src/main/webapp/index.html b/teste/src/main/webapp/index.html new file mode 100644 index 00000000..b58eb71b --- /dev/null +++ b/teste/src/main/webapp/index.html @@ -0,0 +1,37 @@ + + + + + +Fly-Out Nav + + + + + + + + + + +

Solicitação de Pedidos

+ +