<commit_before>package org.jboss.forge.addon.database.tools.generate;

import java.util.ArrayList;

import javax.inject.Inject;

import org.jboss.forge.addon.database.tools.connections.ConnectionProfileManager;
import org.jboss.forge.addon.javaee.jpa.JPAFacet;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.projects.ProjectFactory;
import org.jboss.forge.addon.projects.facets.MetadataFacet;
import org.jboss.forge.addon.projects.ui.AbstractProjectCommand;
import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.context.UINavigationContext;
import org.jboss.forge.addon.ui.hints.InputType;
import org.jboss.forge.addon.ui.input.UIInput;
import org.jboss.forge.addon.ui.input.UISelectOne;
import org.jboss.forge.addon.ui.metadata.WithAttributes;
import org.jboss.forge.addon.ui.result.NavigationResult;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;
import org.jboss.forge.addon.ui.wizard.UIWizard;

public class GenerateEntitiesCommand extends AbstractProjectCommand implements
		UIWizard {

	private static String[] COMMAND_CATEGORY = { "Java EE", "Generate" };
	private static String COMMAND_NAME = "Entities from Tables";
	private static String COMMAND_DESCRIPTION = "Command to generate Java EE entities from database tables.";

	@Inject
	private ProjectFactory projectFactory;

	@Inject
	@WithAttributes(
			label = "Target package", 
			type = InputType.JAVA_PACKAGE_PICKER, 
			description = "The name of the target package in which to generate the entities", 
			required = true)
	private UIInput<String> targetPackage;

	@Inject
	@WithAttributes(
			label = "Connection Profile", 
			description = "Select the database connection profile you want to use")
	private UISelectOne<String> connectionProfile;

	@Override
	public Metadata getMetadata(UIContext context) {
		return Metadata.from(super.getMetadata(context), getClass())
				.name(COMMAND_NAME).description(COMMAND_DESCRIPTION)
				.category(Categories.create(COMMAND_CATEGORY));
	}

	@Inject
	private ConnectionProfileManager manager;

	@Override
	public void initializeUI(UIBuilder builder) throws Exception {<commit_msg>Update to be in the JPA category and follow proper naming<commit_after>package org.jboss.forge.addon.database.tools.generate;

import java.util.ArrayList;

import javax.inject.Inject;

import org.jboss.forge.addon.database.tools.connections.ConnectionProfileManager;
import org.jboss.forge.addon.javaee.jpa.JPAFacet;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.projects.ProjectFactory;
import org.jboss.forge.addon.projects.facets.MetadataFacet;
import org.jboss.forge.addon.projects.ui.AbstractProjectCommand;
import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.context.UINavigationContext;
import org.jboss.forge.addon.ui.hints.InputType;
import org.jboss.forge.addon.ui.input.UIInput;
import org.jboss.forge.addon.ui.input.UISelectOne;
import org.jboss.forge.addon.ui.metadata.WithAttributes;
import org.jboss.forge.addon.ui.result.NavigationResult;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;
import org.jboss.forge.addon.ui.util.Categories;
import org.jboss.forge.addon.ui.util.Metadata;
import org.jboss.forge.addon.ui.wizard.UIWizard;

public class GenerateEntitiesCommand extends AbstractProjectCommand implements
		UIWizard {

	private static String[] COMMAND_CATEGORY = { "Java EE", "JPA" };
	private static String COMMAND_NAME = "JPA: Generate Entities from Tables";
	private static String COMMAND_DESCRIPTION = "Command to generate Java EE entities from database tables.";

	@Inject
	private ProjectFactory projectFactory;

	@Inject
	@WithAttributes(
			label = "Target package", 
			type = InputType.JAVA_PACKAGE_PICKER, 
			description = "The name of the target package in which to generate the entities", 
			required = true)
	private UIInput<String> targetPackage;

	@Inject
	@WithAttributes(
			label = "Connection Profile", 
			description = "Select the database connection profile you want to use")
	private UISelectOne<String> connectionProfile;

	@Override
	public Metadata getMetadata(UIContext context) {
		return Metadata.from(super.getMetadata(context), getClass())
				.name(COMMAND_NAME).description(COMMAND_DESCRIPTION)
				.category(Categories.create(COMMAND_CATEGORY));
	}

	@Inject
	private ConnectionProfileManager manager;

	@Override
	public void initializeUI(UIBuilder builder) throws Exception {
{'fraction_non_alphanumeric': 0.10063799135624614, 'fraction_numerical': 0.0, 'mean_word_length': 5.5943012211668925, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4050530', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1526, 'n_words': 308}