instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public void updateTaskTenantIdForDeployment(String deploymentId, String newTenantId) {
HashMap<String, Object> params = new HashMap<>();
params.put("deploymentId", deploymentId);
params.put("tenantId", newTenantId);
getDbSqlSession().directUpdate("updateTaskTenantIdForDeployment", params... | protected IdGenerator getIdGenerator() {
return taskServiceConfiguration.getIdGenerator();
}
protected void setSafeInValueLists(TaskQueryImpl taskQuery) {
if (taskQuery.getCandidateGroups() != null) {
taskQuery.setSafeCandidateGroups(createSafeInValuesList(taskQuery.getCandidate... | repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\persistence\entity\data\impl\MybatisTaskDataManager.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class TimerJobServiceImpl extends ServiceImpl implements TimerJobService {
public TimerJobServiceImpl(JobServiceConfiguration jobServiceConfiguration) {
super(jobServiceConfiguration);
}
@Override
public TimerJobEntity findTimerJobById(String jobId) {
return getTimerJobEntit... | @Override
public AbstractRuntimeJobEntity moveJobToTimerJob(JobEntity job) {
return getJobManager().moveJobToTimerJob(job);
}
@Override
public TimerJobEntity createTimerJob() {
return getTimerJobEntityManager().create();
}
@Override
public void insertTimerJob(TimerJobEn... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\TimerJobServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class CleanUpService {
private final Optional<HousekeeperClient> housekeeperClient;
private final RelationService relationService;
private final Set<EntityType> skippedEntities = EnumSet.of(
EntityType.ALARM, EntityType.QUEUE, EntityType.TB_RESOURCE, EntityType.OTA_PACKAGE,
... | submitTask(HousekeeperTask.deleteAttributes(tenantId, entityId));
submitTask(HousekeeperTask.deleteTelemetry(tenantId, entityId));
submitTask(HousekeeperTask.deleteEvents(tenantId, entityId));
submitTask(HousekeeperTask.deleteAlarms(tenantId, entityId));
submitTask(HousekeeperTask.delete... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\housekeeper\CleanUpService.java | 2 |
请完成以下Java代码 | public String getCauseIncidentId() {
return causeIncidentId;
}
public void setCauseIncidentId(String causeIncidentId) {
this.causeIncidentId = causeIncidentId;
}
public String getRootCauseIncidentId() {
return rootCauseIncidentId;
}
public void setRootCauseIncidentId(String rootCauseIncidentI... | public void setJobDefinitionId(String jobDefinitionId) {
this.jobDefinitionId = jobDefinitionId;
}
public boolean isOpen() {
return IncidentState.DEFAULT.getStateCode() == incidentState;
}
public boolean isDeleted() {
return IncidentState.DELETED.getStateCode() == incidentState;
}
public bool... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricIncidentEventEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GLCategoryRepository
{
public static GLCategoryRepository get() {return SpringContextHolder.instance.getBean(GLCategoryRepository.class);}
private final IQueryBL queryBL = Services.get(IQueryBL.class);
private static final CCache<ClientId, DefaultGLCategories> defaultsCache = CCache.<ClientId, Default... | }
private static class DefaultGLCategories
{
private final ImmutableMap<GLCategoryType, GLCategory> byCategoryType;
private final ImmutableList<GLCategory> list;
DefaultGLCategories(final ImmutableList<GLCategory> list)
{
this.byCategoryType = Maps.uniqueIndex(list, GLCategory::getCategoryType);
this.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\acct\GLCategoryRepository.java | 2 |
请完成以下Java代码 | public int getAD_PInstance_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_PInstance_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Message Text.
@param MsgText
Textual Informational, Menu or Error Message
*/
@Override
public void setMsgText (java.lang.String MsgText)
{
... | {
set_ValueNoCheck (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@return Method of ordering records; lowest number comes first
*/
@Override
public int getSeqNo ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo);
if (ii == null)
return 0;
return ii.intValue();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\letters\model\X_T_BoilerPlate_Spool.java | 1 |
请完成以下Java代码 | private final void load()
{
URLClassLoader classLoader = null;
try
{
classLoader = (URLClassLoader)getClass().getClassLoader();
}
catch (final Exception e)
{
logger.warn("Cannot load manifests. Only URLClassLoader is supported");
return;
}
final URL resource = classLoader.findResource(RESOUR... | }
if (attributes.containsKey(Name.IMPLEMENTATION_VERSION))
{
implementationVersion = attributes.getValue(Name.IMPLEMENTATION_VERSION);
}
if (attributes.containsKey(NAME_CI_BUILD_NO))
{
ciBuildNo = attributes.getValue(NAME_CI_BUILD_NO.toString());
}
if (attributes.containsKey(NAME_CI_BUILD_TAG))
... | repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\rollout_migrate\BinaryVersion.java | 1 |
请完成以下Java代码 | public final boolean isNumericValue()
{
return X_M_Attribute.ATTRIBUTEVALUETYPE_Number.equals(valueType);
}
@Override
public final boolean isStringValue()
{
return X_M_Attribute.ATTRIBUTEVALUETYPE_StringMax40.equals(valueType);
}
@Override
public final boolean isDateValue()
{
return X_M_Attribute.ATTRI... | }
private IAttributeValueCallout _attributeValueCallout = null;
@Override
public IAttributeValueCallout getAttributeValueCallout()
{
if (_attributeValueCallout == null)
{
final IAttributeValueGenerator attributeValueGenerator = getAttributeValueGeneratorOrNull();
if (attributeValueGenerator instanceof I... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\impl\AbstractAttributeValue.java | 1 |
请完成以下Java代码 | public void close() {
EventRegistryEngines.unregister(this);
if (engineConfiguration.getEventRegistryChangeDetectionExecutor() != null) {
engineConfiguration.getEventRegistryChangeDetectionExecutor().shutdown();
}
engineConfiguration.close();
if (engineConfiguratio... | @Override
public EventRepositoryService getEventRepositoryService() {
return repositoryService;
}
@Override
public EventManagementService getEventManagementService() {
return managementService;
}
@Override
public EventRegistry getEventRegistry() {
return eventRe... | repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\EventRegistryEngineImpl.java | 1 |
请完成以下Java代码 | public void setS_Resource(final org.compiere.model.I_S_Resource S_Resource)
{
set_ValueFromPO(COLUMNNAME_S_Resource_ID, org.compiere.model.I_S_Resource.class, S_Resource);
}
@Override
public void setS_Resource_ID (final int S_Resource_ID)
{
if (S_Resource_ID < 1)
set_ValueNoCheck (COLUMNNAME_S_Resource_ID... | @Override
public org.compiere.model.I_S_Resource getWorkStation()
{
return get_ValueAsPO(COLUMNNAME_WorkStation_ID, org.compiere.model.I_S_Resource.class);
}
@Override
public void setWorkStation(final org.compiere.model.I_S_Resource WorkStation)
{
set_ValueFromPO(COLUMNNAME_WorkStation_ID, org.compiere.model... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order.java | 1 |
请完成以下Java代码 | private Authentication getAuthentication(@Nullable Object user) {
if ((user instanceof Authentication)) {
return (Authentication) user;
}
return this.anonymous;
}
private void cleanup() {
Stack<SecurityContext> contextStack = originalContext.get();
if (contextStack == null || contextStack.isEmpty()) {
... | try {
if (SecurityContextChannelInterceptor.this.empty.equals(context)) {
this.securityContextHolderStrategy.clearContext();
originalContext.remove();
}
else {
this.securityContextHolderStrategy.setContext(context);
}
}
catch (Throwable ex) {
this.securityContextHolderStrategy.clearContex... | repos\spring-security-main\messaging\src\main\java\org\springframework\security\messaging\context\SecurityContextChannelInterceptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void delete(Set<String> ids) {
for (String id : ids) {
databaseRepository.deleteById(id);
}
}
@Override
public boolean testConnection(Database resources) {
try {
return SqlUtils.testConnection(resources.getJdbcUrl(), resources.getUserName(), resources.... | @Override
public void download(List<DatabaseDto> queryAll, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (DatabaseDto databaseDto : queryAll) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("数据库名称", databa... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\maint\service\impl\DatabaseServiceImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ImperativeHttpClientsProperties {
/**
* Default factory used for a client HTTP request.
*/
private @Nullable Factory factory;
public @Nullable Factory getFactory() {
return this.factory;
}
public void setFactory(@Nullable Factory factory) {
this.factory = factory;
}
/**
* Supported fac... | */
REACTOR(ClientHttpRequestFactoryBuilder::reactor),
/**
* Java's HttpClient.
*/
JDK(ClientHttpRequestFactoryBuilder::jdk),
/**
* Standard JDK facilities.
*/
SIMPLE(ClientHttpRequestFactoryBuilder::simple);
private final Supplier<ClientHttpRequestFactoryBuilder<?>> builderSupplier;
Factor... | repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\autoconfigure\imperative\ImperativeHttpClientsProperties.java | 2 |
请完成以下Java代码 | public I_M_HU_Item retrieveParentItem(final I_M_HU hu)
{
return db.retrieveParentItem(hu);
}
@Override
public ArrayList<I_M_HU> retrieveIncludedHUs(@NonNull final I_M_HU_Item huItem)
{
final HuItemId huItemKey = mkHUItemKey(huItem);
ArrayList<I_M_HU> includedHUs = huItemKey2includedHUs.get(huItemKey);
if ... | //
// Add HU to include HUs list of new parent (if any)
final HuItemId parentHUItemIdNew = HuItemId.ofRepoIdOrNull(hu.getM_HU_Item_Parent_ID());
if (parentHUItemIdNew != null)
{
final ArrayList<I_M_HU> includedHUs = huItemKey2includedHUs.get(parentHUItemIdNew);
if (includedHUs != null)
{
boolean ad... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\CachedHUAndItemsDAO.java | 1 |
请完成以下Java代码 | public DecisionEvaluationBuilder decisionDefinitionTenantId(String tenantId) {
this.decisionDefinitionTenantId = tenantId;
isTenantIdSet = true;
return this;
}
public DecisionEvaluationBuilder decisionDefinitionWithoutTenantId() {
this.decisionDefinitionTenantId = null;
isTenantIdSet = true;
... | public static DecisionEvaluationBuilder evaluateDecisionTableById(CommandExecutor commandExecutor, String decisionDefinitionId) {
DecisionTableEvaluationBuilderImpl builder = new DecisionTableEvaluationBuilderImpl(commandExecutor);
builder.decisionDefinitionId = decisionDefinitionId;
return builder;
}
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\dmn\DecisionTableEvaluationBuilderImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ConfigTreeConfigDataLocationResolver implements ConfigDataLocationResolver<ConfigTreeConfigDataResource> {
private static final String PREFIX = "configtree:";
private final LocationResourceLoader resourceLoader;
public ConfigTreeConfigDataLocationResolver(ResourceLoader resourceLoader) {
this.resou... | throw new ConfigDataLocationNotFoundException(location, ex);
}
}
private List<ConfigTreeConfigDataResource> resolve(String location) throws IOException {
Assert.state(location.endsWith("/"),
() -> String.format("Config tree location '%s' must end with '/'", location));
if (!this.resourceLoader.isPattern(lo... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\ConfigTreeConfigDataLocationResolver.java | 2 |
请完成以下Java代码 | public void updateEventSubscriptionTenantId(String oldTenantId, String newTenantId) {
Map<String, String> params = new HashMap<String, String>();
params.put("oldTenantId", oldTenantId);
params.put("newTenantId", newTenantId);
getDbSqlSession().update("updateTenantIdOfEventSubscriptions",... | return signalEventSubscriptionEntities;
}
protected List<MessageEventSubscriptionEntity> toMessageEventSubscriptionEntityList(
List<EventSubscriptionEntity> result
) {
List<MessageEventSubscriptionEntity> messageEventSubscriptionEntities = new ArrayList<
MessageEventSubscription... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\data\impl\MybatisEventSubscriptionDataManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UmsResourceCategoryController {
@Autowired
private UmsResourceCategoryService resourceCategoryService;
@ApiOperation("查询所有后台资源分类")
@RequestMapping(value = "/listAll", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsResourceCategory>> listAll() {
List<U... | return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@ApiOperation("根据ID删除后台资源分类")
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult delete(@PathVariable Long id) {
int count = resourc... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\controller\UmsResourceCategoryController.java | 2 |
请完成以下Java代码 | public class MInOutHUDocumentFactory extends AbstractHUDocumentFactory<I_M_InOut>
{
private final IUOMDAO uomDAO = Services.get(IUOMDAO.class);
public MInOutHUDocumentFactory()
{
super(I_M_InOut.class);
}
@Override
protected void createHUDocumentsFromTypedModel(final HUDocumentsCollector documentsCollector, ... | final List<I_M_Transaction> mtrxs = Services.get(IMTransactionDAO.class).retrieveReferenced(ioLine);
for (final I_M_Transaction mtrx : mtrxs)
{
final MInOutLineHUDocumentLine sourceLine = new MInOutLineHUDocumentLine(ioLine, mtrx);
sourceLines.add(sourceLine);
}
//
// Create Target Qty
final ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\impl\MInOutHUDocumentFactory.java | 1 |
请完成以下Java代码 | public Mono<Void> onAuthenticationSuccess(WebFilterExchange exchange, Authentication authentication) {
return this.sessionLimit.apply(authentication)
.flatMap((maxSessions) -> handleConcurrency(exchange, authentication, maxSessions));
}
private Mono<Void> handleConcurrency(WebFilterExchange exchange, Authentica... | if (registeredSession.getSessionId().equals(currentSession.getId())) {
return Mono.empty();
}
}
}
return this.maximumSessionsExceededHandler.handle(new MaximumSessionsContext(authentication,
registeredSessions, maximumSessions, currentSession));
});
}
/**
* Sets the strategy used... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\authentication\ConcurrentSessionControlServerAuthenticationSuccessHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setName(String name) {
this.name = name;
}
@ApiModelProperty(example = "2010-10-13T14:54:26.750+02:00")
public Date getDeploymentTime() {
return deploymentTime;
}
public void setDeploymentTime(Date deploymentTime) {
this.deploymentTime = deploymentTime;
}
... | public void setUrl(String url) {
this.url = url;
}
@ApiModelProperty(example = "http://localhost:8081/flowable-rest/service/cmmn-repository/deployments/10")
public String getUrl() {
return url;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\repository\CmmnDeploymentResponse.java | 2 |
请完成以下Java代码 | public int hashCode() {
return this.value.hashCode();
}
@Override
public String toString() {
return this.value;
}
/**
* Factory method to create a new {@link WebServerNamespace} from a value. If the
* context is {@code null} or not a web server context then {@link #SERVER} is
* returned.
* @param con... | }
return from(WebServerApplicationContext.getServerNamespace(context));
}
/**
* Factory method to create a new {@link WebServerNamespace} from a value. If the
* value is empty or {@code null} then {@link #SERVER} is returned.
* @param value the namespace value or {@code null}
* @return the web server names... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\endpoint\web\WebServerNamespace.java | 1 |
请完成以下Java代码 | public static void main(String[] args) throws SQLException {
//1. 全局配置
GlobalConfig config = new GlobalConfig();
config.setActiveRecord(true) // 是否支持AR模式
.setAuthor("yuhao.wang3") // 作者
//.setOutputDir("D:\\workspace_mp\\mp03\\src\\main\\java") // 生成路径
... | .setControllerMappingHyphenStyle(true)
.setRestControllerStyle(true)
.setEntityLombokModel(true)
.setColumnNaming(NamingStrategy.underline_to_camel)
.setNaming(NamingStrategy.underline_to_camel) // 数据库表映射到实体的命名策略
// .setTablePrefix("tbl_")
... | repos\spring-boot-student-master\spring-boot-student-mybatis-plus\src\main\java\com\xiaolyuh\MyBatisPlusGenerator.java | 1 |
请完成以下Java代码 | public Map<Integer, Integer> getTranslatedPortMappings() {
return this.httpsPortMappings;
}
@Override
public @Nullable Integer lookupHttpPort(Integer httpsPort) {
for (Integer httpPort : this.httpsPortMappings.keySet()) {
if (this.httpsPortMappings.get(httpPort).equals(httpsPort)) {
return httpPort;
}... | * number.
* @throws IllegalArgumentException if input map does not consist of String keys and
* values, each representing an integer port number in the range 1-65535 for that
* mapping.
*/
public void setPortMappings(Map<String, String> newMappings) {
Assert.notNull(newMappings, "A valid list of HTTPS port m... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\PortMapperImpl.java | 1 |
请完成以下Java代码 | public class EventSubscriptionsByNameMatcher extends CachedEntityMatcherAdapter<EventSubscriptionEntity> {
@Override
@SuppressWarnings("unchecked")
public boolean isRetained(EventSubscriptionEntity eventSubscriptionEntity, Object parameter) {
Map<String, String> params = (Map<String, String>) param... | if (tenantId != null && !tenantId.equals(ProcessEngineConfiguration.NO_TENANT_ID)) {
return (
eventSubscriptionEntity.getTenantId() != null &&
eventSubscriptionEntity.getTenantId().equals(tenantId)
);
} else {
return (
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\data\impl\cachematcher\EventSubscriptionsByNameMatcher.java | 1 |
请完成以下Java代码 | protected String getTargetTableName()
{
return org.compiere.model.I_M_Product.Table_Name;
}
@Override
protected String getImportOrderBySql()
{
return I_I_Pharma_Product.COLUMNNAME_A01GDAT;
}
@Override
public I_I_Pharma_Product retrieveImportRecord(final Properties ctx, final ResultSet rs)
{
return new ... | if (!newProduct && isInsertOnly)
{
// #4994 do not update entries
return ImportRecordResult.Nothing;
}
if (newProduct)
{
product = IFAProductImportHelper.createProduct(importRecord);
}
else
{
product = IFAProductImportHelper.updateProduct(importRecord, existentProduct);
}
imp... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java\de\metas\impexp\product\IFAInitialImportProcess2.java | 1 |
请完成以下Java代码 | public void columnRemoved(TableColumnModelEvent e)
{
markPopupStaled();
}
/** Tells listeners that a column was repositioned. */
@Override
public void columnMoved(TableColumnModelEvent e)
{
if (e.getFromIndex() == e.getToIndex())
{
// not actually a change
return;
}
... | /** Tells listeners that a column was moved due to a margin change. */
@Override
public void columnMarginChanged(ChangeEvent e)
{
// nothing to do
}
/**
* Tells listeners that the selection model of the TableColumnModel changed.
*/
@Override
public void columnSelectionChanged(ListSelec... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\swing\CColumnControlButton.java | 1 |
请完成以下Java代码 | public void setUserCache(UserCache userCache) {
Assert.notNull(userCache, "userCache cannot be null");
this.userCache = userCache;
}
/**
* Sets whether the {@link #updatePassword(UserDetails, String)} method should
* actually update the password.
* <p>
* Defaults to {@code false} to prevent accidental pa... | /**
* Conditionally updates password based on the setting from
* {@link #setEnableUpdatePassword(boolean)}. {@inheritDoc}
* @since 7.0
*/
@Override
public UserDetails updatePassword(UserDetails user, @Nullable String newPassword) {
if (this.enableUpdatePassword) {
// @formatter:off
UserDetails updated... | repos\spring-security-main\core\src\main\java\org\springframework\security\provisioning\JdbcUserDetailsManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ModelRequest {
protected String name;
protected String key;
protected String category;
protected Integer version;
protected String metaInfo;
protected String deploymentId;
protected String tenantId;
protected boolean nameChanged;
protected boolean keyChanged;
prote... | }
public void setMetaInfo(String metaInfo) {
this.metaInfo = metaInfo;
this.metaInfoChanged = true;
}
@ApiModelProperty(example = "7")
public String getDeploymentId() {
return deploymentId;
}
public void setDeploymentId(String deploymentId) {
this.deploymentId ... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\repository\ModelRequest.java | 2 |
请完成以下Java代码 | public class WebsocketTopicNames
{
static final String TOPIC_UserSession = "/userSession";
static final String TOPIC_Notifications = "/notifications";
static final String TOPIC_View = "/view";
static final String TOPIC_Document = "/document";
static final String TOPIC_Board = "/board";
public static final String ... | return WebsocketTopicName.ofString(TOPIC_View + "/" + viewId);
}
public static WebsocketTopicName buildDocumentTopicName(
@NonNull final WindowId windowId,
@NonNull final DocumentId documentId)
{
return WebsocketTopicName.ofString(TOPIC_Document + "/" + windowId.toJson() + "/" + documentId.toJson());
}
p... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\websocket\WebsocketTopicNames.java | 1 |
请完成以下Spring Boot application配置 | spring:
application:
name: demo-consumer # Spring 应用名
cloud:
nacos:
# Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类
discovery:
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
server:
port: 28080 # 服务器端口。默认为 80 | 80
feign:
httpclient:
enabled: false # 是否开启。默认为 true
okhttp:
enabled: true # 是否开启。默认为 false | repos\SpringBoot-Labs-master\labx-03-spring-cloud-feign\labx-03-sc-feign-demo06B-consumer\src\main\resources\application.yaml | 2 |
请在Spring Boot框架中完成以下Java代码 | public class EntityManagerSessionFactory implements SessionFactory {
protected EntityManagerFactory entityManagerFactory;
protected boolean handleTransactions;
protected boolean closeEntityManager;
public EntityManagerSessionFactory(Object entityManagerFactory, boolean handleTransactions, boolean clos... | this.closeEntityManager = closeEntityManager;
}
@Override
public Class<?> getSessionType() {
return EntityManagerSession.class;
}
@Override
public Session openSession(CommandContext commandContext) {
return new EntityManagerSessionImpl(entityManagerFactory, handleTransactions, ... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\types\EntityManagerSessionFactory.java | 2 |
请完成以下Java代码 | @Nullable ExpressionAttribute resolveAttribute(Method method, @Nullable Class<?> targetClass) {
PostAuthorize postAuthorize = findPostAuthorizeAnnotation(method, targetClass);
if (postAuthorize == null) {
return null;
}
Expression expression = getExpressionHandler().getExpressionParser().parseExpression(post... | private MethodAuthorizationDeniedHandler resolveHandler(ApplicationContext context,
Class<? extends MethodAuthorizationDeniedHandler> handlerClass) {
if (handlerClass == this.defaultHandler.getClass()) {
return this.defaultHandler;
}
String[] beanNames = context.getBeanNamesForType(handlerClass);
if (bean... | repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\method\PostAuthorizeExpressionAttributeRegistry.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AsyncBatchTypeId implements RepoIdAware
{
int repoId;
private AsyncBatchTypeId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "C_Async_Batch_Type_ID");
}
@JsonCreator
public static AsyncBatchTypeId ofRepoId(final int repoId)
{
return new AsyncBatchTypeId(repoId);
}
pu... | return repoId > 0 ? new AsyncBatchTypeId(repoId) : null;
}
public static Optional<AsyncBatchTypeId> optionalOfRepoId(final int repoId)
{
return Optional.ofNullable(ofRepoIdOrNull(repoId));
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\AsyncBatchTypeId.java | 2 |
请完成以下Java代码 | private void initPanel()
{
BoxLayout layout = new BoxLayout(this, BoxLayout.PAGE_AXIS);
MGoal[] goals = MGoal.getGoals(Env.getCtx());
for (int i = 0; i < goals.length; i++)
{
PerformanceIndicator pi = new PerformanceIndicator(goals[i]);
pi.addActionListener(this);
add (pi);
}
} // initPanel
/**
... | */
@Override
public void actionPerformed (ActionEvent e)
{
if (e.getActionCommand().equals(ConfirmPanel.A_OK))
dispose();
else if (e.getSource() instanceof PerformanceIndicator)
{
PerformanceIndicator pi = (PerformanceIndicator)e.getSource();
log.info(pi.getName());
MGoal goal = pi.getGoal();
if... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\adempiere\apps\graph\ViewPI.java | 1 |
请完成以下Java代码 | public GridFieldVOsLoader setTabReadOnly(final boolean tabReadOnly)
{
_tabReadOnly = tabReadOnly;
return this;
}
private boolean isTabReadOnly()
{
return _tabReadOnly;
}
public GridFieldVOsLoader setLoadAllLanguages(final boolean loadAllLanguages)
{
_loadAllLanguages = loadAllLanguages;
return this;
... | {
return _loadAllLanguages;
}
public GridFieldVOsLoader setApplyRolePermissions(final boolean applyRolePermissions)
{
this._applyRolePermissions = applyRolePermissions;
return this;
}
private boolean isApplyRolePermissions()
{
return _applyRolePermissions;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\GridFieldVOsLoader.java | 1 |
请完成以下Java代码 | public class ViewPI extends CPanel
implements FormPanel, ActionListener
{
/**
*
*/
private static final long serialVersionUID = 8022906851004145960L;
/**
* Init
* @param WindowNo
* @param frame
*/
@Override
public void init (int WindowNo, FormFrame frame)
{
log.debug("");
m_WindowNo = WindowNo... | /** FormFrame */
private FormFrame m_frame;
/** Logger */
private static Logger log = LogManager.getLogger(ViewPI.class);
/** Confirmation Panel */
private ConfirmPanel confirmPanel = ConfirmPanel.newWithOK();
/**
* Init Panel
*/
private void initPanel()
{
BoxLayout layout = new BoxLayout(this, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\adempiere\apps\graph\ViewPI.java | 1 |
请完成以下Java代码 | private boolean checkNonEssentialData(String currentTableName, Map<String, Object> afterMap,
Map<String, Object> beforeMap, List<String> filterColumnList) {
Map<String, Boolean> filterMap = new HashMap<>(16);
for (String key : afterMap.keySet()) {
Ob... | Map<String, Object> changeData = struct.schema().fields().stream()
.map(Field::name)
.filter(fieldName -> struct.get(fieldName) != null)
.map(fieldName -> Pair.of(fieldName, struct.get(fieldName)))
.collect(toMap(Pair::getKey, Pair::getValue));
if ... | repos\springboot-demo-master\debezium\src\main\java\com\et\debezium\handler\ChangeEventHandler.java | 1 |
请完成以下Java代码 | public int getPP_Order_Qty_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Order_Qty_ID);
}
@Override
public void setProcessed (final boolean Processed)
{
set_Value (COLUMNNAME_Processed, Processed);
}
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed); | }
@Override
public void setQty (final BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
return bd != null ? bd : BigDecimal.ZERO;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_PP_Order_Qty.java | 1 |
请完成以下Java代码 | public class Order {
@JsonView(Views.Public.class)
private UUID id;
@JsonView(Views.Public.class)
private Type type;
@JsonView(Views.Internal.class)
private int internalAudit;
public static class Type {
public long id;
public String name;
}
public Order() {
... | public Order(int internalAudit) {
this();
this.type = new Type();
this.type.id = 20;
this.type.name = "Order";
this.internalAudit = internalAudit;
}
public UUID getId() {
return id;
}
public Type getType() {
return type;
}
public void se... | repos\tutorials-master\video-tutorials\jackson-annotations-video\src\main\java\com\baeldung\jacksonannotation\general\jsonview\Order.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public SyncUser createSyncUser(final String email, final String password, @Nullable final String language)
{
return SyncUser.builder()
.uuid(randomUUID())
.email(email)
.password(password)
.language(language)
.build();
}
public SyncProduct createSyncProduct(final String name, final String pack... | continue;
}
final ContractLine contractLine = contractLines.get(0);
final Product product = contractLine.getProduct();
productSuppliesService.reportSupply(IProductSuppliesService.ReportDailySupplyRequest.builder()
.bpartner(bpartner)
.contractLine(contractLine)
.productId(product.get... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\util\DummyDataProducer.java | 2 |
请完成以下Java代码 | private static long getParameterValue(Map<String, Object> parameters, String parameterName, long defaultValue) {
long parameterValue = defaultValue;
Object obj = parameters.get(parameterName);
if (obj != null) {
// Final classes Long and Integer do not need to be coerced
if (obj.getClass() == Long.cla... | public Map<String, Object> convert(OAuth2DeviceAuthorizationResponse deviceAuthorizationResponse) {
Map<String, Object> parameters = new HashMap<>();
parameters.put(OAuth2ParameterNames.DEVICE_CODE,
deviceAuthorizationResponse.getDeviceCode().getTokenValue());
parameters.put(OAuth2ParameterNames.USER_CODE... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\http\converter\OAuth2DeviceAuthorizationResponseHttpMessageConverter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Path getPath() {
return path;
}
public void setPath(Path path) {
this.path = path;
}
public DomainUrl getDomainUrl() {
return domainUrl;
}
public void setDomainUrl(DomainUrl domainUrl) {
this.domainUrl = domainUrl;
}
public String getSignUrls() {... | this.fileViewDomain = fileViewDomain;
}
public String getUploadType() {
return uploadType;
}
public void setUploadType(String uploadType) {
this.uploadType = uploadType;
}
public WeiXinPay getWeiXinPay() {
return weiXinPay;
}
public void setWeiXinPay(WeiXinPay... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\JeecgBaseConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void onRepartitionEvent() {
lastGaugesByServiceId.clear();
gaugesReportCycles.clear();
}
public ApiUsageStateValue getFeatureValue(ApiFeature feature) {
switch (feature) {
case TRANSPORT:
return apiUsageState.getTransportState();
case RE:
... | case EMAIL:
apiUsageState.setEmailExecState(value);
break;
case SMS:
apiUsageState.setSmsExecState(value);
break;
case ALARM:
apiUsageState.setAlarmExecState(value);
break;
}
return !c... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\apiusage\BaseApiUsageState.java | 2 |
请完成以下Java代码 | public static <TERM> Map<TERM, Double> tfIdf(Map<TERM, Double> tf, Map<TERM, Double> idf,
Normalization normalization)
{
Map<TERM, Double> tfIdf = new HashMap<TERM, Double>();
for (TERM term : tf.keySet())
{
Double TF = tf.get(term... | /**
* Map的迭代器
*
* @param <KEY> map 键类型
* @param <VALUE> map 值类型
*/
static private class KeySetIterable<KEY, VALUE> implements Iterable<Iterable<KEY>>
{
final private Iterator<Map<KEY, VALUE>> maps;
public KeySetIterable(Iterable<Map<KEY, VALUE>> maps)
{
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word\TfIdf.java | 1 |
请完成以下Java代码 | public class ScriptHttpHandler extends AbstractScriptEvaluator implements HttpRequestHandler, HttpResponseHandler {
public ScriptHttpHandler(Expression language, String script) {
super(language, script);
}
@Override
protected ScriptingEngines getScriptingEngines() {
return CommandConte... | } else {
throw new FlowableIllegalStateException(
"The given execution " + execution.getClass().getName() + " is not of type " + VariableScope.class.getName());
}
}
@Override
public void handleHttpResponse(VariableContainer execution, HttpResponse httpResponse) {
... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\bpmn\http\handler\ScriptHttpHandler.java | 1 |
请完成以下Java代码 | private static DDOrderRef extractDDOrderRef(final I_MD_Candidate_Dist_Detail record)
{
final int ddOrderCandidateId = record.getDD_Order_Candidate_ID();
final int ddOrderId = record.getDD_Order_ID();
if (ddOrderCandidateId <= 0 && ddOrderId <= 0)
{
return null;
}
return DDOrderRef.builder()
.ddOrde... | public BusinessCaseDetail withPPOrderId(@Nullable final PPOrderId newPPOrderId)
{
final PPOrderRef ppOrderRefNew = PPOrderRef.withPPOrderId(forwardPPOrderRef, newPPOrderId);
if (Objects.equals(this.forwardPPOrderRef, ppOrderRefNew))
{
return this;
}
return toBuilder().forwardPPOrderRef(ppOrderRefNew).bui... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\candidate\businesscase\DistributionDetail.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Long getId() {
return this.id;
}
public Car id(Long id) {
this.setId(id);
return this;
}
public void setId(Long id) {
this.id = id;
}
public Double getPrice() {
return this.price;
}
public Car price(Double price) {
this.setPrice(... | return true;
}
if (!(o instanceof Car)) {
return false;
}
return getId() != null && getId().equals(((Car) o).getId());
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier... | repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\car-app\src\main\java\com\cars\app\domain\Car.java | 2 |
请完成以下Java代码 | public class UidGenerateException extends RuntimeException {
/**
* Serial Version UID
*/
private static final long serialVersionUID = -27048199131316992L;
/**
* Default constructor
*/
public UidGenerateException() {
super();
}
/**
* Constructor with message & ... | /**
* Constructor with message format
*
* @param msgFormat
* @param args
*/
public UidGenerateException(String msgFormat, Object... args) {
super(String.format(msgFormat, args));
}
/**
* Constructor with cause
*
* @param cause
*/
public UidGenerate... | repos\Spring-Boot-In-Action-master\id-spring-boot-starter\src\main\java\com\baidu\fsg\uid\exception\UidGenerateException.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getPath() {
return this.path;
}
public void setPath(String path) {
this.path = path;
}
public boolean isIncludeException() {
return this.includeException;
}
public void setIncludeException(boolean includeException) {
this.includeException = includeException;
}
public IncludeAttribute g... | }
/**
* Include error attributes options.
*/
public enum IncludeAttribute {
/**
* Never add error attribute.
*/
NEVER,
/**
* Always add error attribute.
*/
ALWAYS,
/**
* Add error attribute when the appropriate request parameter is not "false".
*/
ON_PARAM
}
public static cla... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\web\ErrorProperties.java | 2 |
请完成以下Java代码 | public class ChatSendParams {
public ChatSendParams(String content, String conversationId, String topicId, String appId) {
this.content = content;
this.conversationId = conversationId;
this.topicId = topicId;
this.appId = appId;
}
/**
* 用户输入的聊天内容
*/
private St... | /**
* 应用id
*/
private String appId;
/**
* 图片列表
*/
private List<String> images;
/**
* 工作流额外入参配置
* key: 参数field, value: 参数值
* for [issues/8545]新建AI应用的时候只能选择没有自定义参数的AI流程
*/
private Map<String, Object> flowInputs;
/**
* 是否开启网络搜索(仅千问模型支持)
*/
pr... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-boot-module-airag\src\main\java\org\jeecg\modules\airag\app\vo\ChatSendParams.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8081
spring:
boot:
admin:
client:
url: http://localhost:8088
management:
endpoints:
web:
exposure:
include: '*'
info:
| env:
enabled: true
logging:
file:
name: ./logs/sba-client.log | repos\spring-boot-best-practice-master\spring-boot-admin-client\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public int retrieveLastLineNo(final DocumentQuery query)
{
throw new UnsupportedOperationException();
}
private static final class ProcessInfoParameterDocumentValuesSupplier implements DocumentValuesSupplier
{
private final DocumentId adPInstanceId;
private final Map<String, ProcessInfoParameter> processInfo... | {
return adPInstanceId;
}
@Override
public String getVersion()
{
return VERSION_DEFAULT;
}
@Override
public Object getValue(final DocumentFieldDescriptor parameterDescriptor)
{
return extractParameterValue(processInfoParameters, parameterDescriptor);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\adprocess\ADProcessParametersRepository.java | 1 |
请完成以下Java代码 | public void setAnfragePzn(long value) {
this.anfragePzn = value;
}
/**
* Gets the value of the substitution property.
*
* @return
* possible object is
* {@link VerfuegbarkeitSubstitution }
*
*/
public VerfuegbarkeitSubstitution getSubstitution() {
... | * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the anteile property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAnteile().add(n... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.schema.v1\src\main\java-xjc\de\metas\vertical\pharma\vendor\gateway\msv3\schema\v1\VerfuegbarkeitsantwortArtikel.java | 1 |
请完成以下Java代码 | public class AppResourceEntityImpl extends AbstractAppEngineNoRevisionEntity implements AppResourceEntity, Serializable {
private static final long serialVersionUID = 1L;
protected String name;
protected byte[] bytes;
protected String deploymentId;
protected boolean generated;
public AppR... | public Object getPersistentState() {
return AppResourceEntityImpl.class;
}
@Override
public boolean isGenerated() {
return false;
}
@Override
public void setGenerated(boolean generated) {
this.generated = generated;
}
@Override
public String toString() {
... | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\persistence\entity\AppResourceEntityImpl.java | 1 |
请完成以下Java代码 | private boolean isProcessCandidates()
{
final ProcessIssueCandidatesPolicy processCandidatesPolicy = this.processCandidatesPolicy;
if (ProcessIssueCandidatesPolicy.NEVER.equals(processCandidatesPolicy))
{
return false;
}
else if (ProcessIssueCandidatesPolicy.ALWAYS.equals(processCandidatesPolicy))
{
... | }
public HUPPOrderIssueProducer changeHUStatusToIssued(final boolean changeHUStatusToIssued)
{
this.changeHUStatusToIssued = changeHUStatusToIssued;
return this;
}
public HUPPOrderIssueProducer generatedBy(final IssueCandidateGeneratedBy generatedBy)
{
this.generatedBy = generatedBy;
return this;
}
pu... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\api\HUPPOrderIssueProducer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class HomeController {
//
@Autowired
private JWTUtility jwtUtility;
@Autowired
private AuthenticationManager authenticationManager;
@Autowired
private UserService userService;
@GetMapping("/")
public String home() {
return "Welcome to Security ";
}
@PostMap... | try {
authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(
jwtRequest.getUsername(),
jwtRequest.getPassword()));
} catch (DisabledException e) {
throw new Exception("USER_DISABLED", e);
... | repos\SpringBoot-Projects-FullStack-master\Advanced-SpringSecure\secure-jwt-project\secure-jwt-project\src\main\java\uz\bepro\securejwtproject\controller\HomeController.java | 2 |
请完成以下Java代码 | public Long getTopicId() {
return topicId;
}
public void setTopicId(Long topicId) {
this.topicId = topicId;
}
public String getMemberIcon() {
return memberIcon;
}
public void setMemberIcon(String memberIcon) {
this.memberIcon = memberIcon;
}
public Str... | public Integer getShowStatus() {
return showStatus;
}
public void setShowStatus(Integer showStatus) {
this.showStatus = showStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.appen... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\CmsTopicComment.java | 1 |
请完成以下Java代码 | public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException {
return uploadFileWithHttpInfo(petId, additionalMetadata, file).getBody();
}
/**
* uploads an image
*
* <p><b>200</b> - successful operation
* @param petId ID of pet to u... | formParams.add("file", new FileSystemResource(file));
final String[] accepts = {
"application/json"
};
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"multipart/form-data"
};
final MediaType c... | repos\tutorials-master\spring-swagger-codegen-modules\spring-openapi-generator-api-client\src\main\java\com\baeldung\petstore\client\api\PetApi.java | 1 |
请完成以下Java代码 | public class CRFLexicalAnalyzer extends AbstractLexicalAnalyzer
{
/**
* 构造CRF词法分析器
*
* @param segmenter CRF分词器
*/
public CRFLexicalAnalyzer(CRFSegmenter segmenter)
{
this.segmenter = segmenter;
}
/**
* 构造CRF词法分析器
*
* @param segmenter CRF分词器
* @param p... | /**
* 构造CRF词法分析器
*
* @param cwsModelPath CRF分词器模型路径
* @param posModelPath CRF词性标注器模型路径
*/
public CRFLexicalAnalyzer(String cwsModelPath, String posModelPath) throws IOException
{
this(new CRFSegmenter(cwsModelPath), new CRFPOSTagger(posModelPath));
}
/**
* 构造CRF词法分... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\CRFLexicalAnalyzer.java | 1 |
请完成以下Java代码 | private static String extractAppliesOnTableName(final ImmutableList<ViewHeaderPropertiesProvider> providers)
{
final ImmutableSet<String> tableNames = providers.stream()
.map(ViewHeaderPropertiesProvider::getAppliesOnlyToTableName)
.filter(Objects::nonNull)
.distinct()
.collect(ImmutableSet.toImmutab... | {
ViewHeaderProperties computedHeaderProperties = currentHeaderProperties;
for (final ViewHeaderPropertiesProvider provider : providers)
{
final ViewHeaderPropertiesIncrementalResult partialResult = provider.computeIncrementallyOnRowsChanged(
computedHeaderProperties,
view,
changedRowIds,
w... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\CompositeViewHeaderPropertiesProvider.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:mysql://127.0.0.1/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC&useSSL=true
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring. | jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql= true
spring.thymeleaf.cache=false | repos\spring-boot-leaning-master\1.x\第06课:Jpa 和 Thymeleaf 实践\spring-boot-jpa-thymeleaf\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | default Page<ESProductDO> search(Integer cid, String keyword, Pageable pageable) {
NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder();
// 筛选条件 cid
if (cid != null) {
nativeSearchQueryBuilder.withFilter(QueryBuilders.termQuery("cid", cid));
}
... | if (StringUtils.hasText(keyword)) { // 关键字,使用打分
nativeSearchQueryBuilder.withSort(SortBuilders.scoreSort().order(SortOrder.DESC));
} else if (pageable.getSort().isSorted()) { // 有排序,则进行拼接
pageable.getSort().get().forEach(sortField -> nativeSearchQueryBuilder.withSort(SortBuilders.fieldSo... | repos\SpringBoot-Labs-master\lab-15-spring-data-es\lab-15-spring-data-jest\src\main\java\cn\iocoder\springboot\lab15\springdatajest\repository\ProductRepository03.java | 2 |
请完成以下Java代码 | public List<Integer> getValueAsIntList()
{
return getValueAsList(DocumentFilterParam::convertToInt);
}
@Nullable
private static Integer convertToInt(final Object itemObj)
{
if (itemObj == null)
{
// pass-through, even though it will produce an exception when the list will be converted to immutable list
... | public static final class Builder
{
private boolean joinAnd = true;
private String fieldName;
private Operator operator = Operator.EQUAL;
@Nullable private Object value;
@Nullable private Object valueTo;
private Builder()
{
super();
}
public DocumentFilterParam build()
{
return new Document... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\DocumentFilterParam.java | 1 |
请完成以下Java代码 | private int getPageLength(final LookupDataSourceContext evalCtxParam)
{
final int ctxPageLength = evalCtxParam.getLimit(0);
if (ctxPageLength > 0)
{
return ctxPageLength;
}
if (this.pageLength > 0)
{
return this.pageLength;
}
else
{
return DEFAULT_PAGE_SIZE;
}
}
@Override
public final ... | {
final SqlAndParams sqlAndParams = this.sqlForFetchingLookupById.evaluate(evalCtx).orElse(null);
if (sqlAndParams == null)
{
return LookupValuesList.EMPTY;
}
final String adLanguage = evalCtx.getAD_Language();
final ImmutableList<LookupValue> rows = DB.retrieveRows(
sqlAndParams.getSql(),
sqlA... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\lookup\GenericSqlLookupDataSourceFetcher.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PatientHospital dischargeDate(LocalDate dischargeDate) {
this.dischargeDate = dischargeDate;
return this;
}
/**
* letztes Entlassdatum aus der Klinik
* @return dischargeDate
**/
@Schema(example = "Thu Nov 21 00:00:00 GMT 2019", description = "letztes Entlassdatum aus der Klinik")
public... | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PatientHospital {\n");
sb.append(" hospitalId: ").append(toIndentedString(hospitalId)).append("\n");
sb.append(" dischargeDate: ").append(toIndentedString(dischargeDate)).append("\n");
sb.appen... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\model\PatientHospital.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private BigDecimal calcTotalAmount(List<CartPromotionItem> cartItemList) {
BigDecimal total = new BigDecimal("0");
for (CartPromotionItem item : cartItemList) {
BigDecimal realPrice = item.getPrice().subtract(item.getReduceAmount());
total=total.add(realPrice.multiply(new BigDeci... | }
return total;
}
private BigDecimal calcTotalAmountByProductId(List<CartPromotionItem> cartItemList,List<Long> productIds) {
BigDecimal total = new BigDecimal("0");
for (CartPromotionItem item : cartItemList) {
if(productIds.contains(item.getProductId())){
B... | repos\mall-master\mall-portal\src\main\java\com\macro\mall\portal\service\impl\UmsMemberCouponServiceImpl.java | 2 |
请完成以下Spring Boot application配置 | quarkus.http.auth.basic=true
quarkus.security.users.embedded.enabled=true
quarkus.security.users.embedded.plain-text=true
quarkus.security.users.embedded.users.john=secret1
quarkus.security.users.embedded.roles.john=admin,use | r
quarkus.security.users.embedded.users.reza=test
quarkus.security.users.embedded.roles.reza=user | repos\tutorials-master\quarkus-modules\quarkus-clientbasicauth\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public class MapValueProvider implements ParameterValueProvider {
protected TreeMap<ParameterValueProvider, ParameterValueProvider> providerMap;
public MapValueProvider(TreeMap<ParameterValueProvider, ParameterValueProvider> providerMap) {
this.providerMap = providerMap;
}
public Object getValue(Variable... | return providerMap;
}
public void setProviderMap(TreeMap<ParameterValueProvider, ParameterValueProvider> providerMap) {
this.providerMap = providerMap;
}
/**
* @return this method currently always returns false, but that might change in the future.
*/
@Override
public boolean isDynamic() {
/... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\variable\mapping\value\MapValueProvider.java | 1 |
请完成以下Java代码 | public class FutureValue<T> implements Future<T>
{
private T value = null;
private Exception exception = null;
private boolean done = false;
private boolean canceled = false;
private final CountDownLatch latch = new CountDownLatch(1);
public void set(final T value)
{
if (done)
{
throw new IllegalStateE... | public boolean isCancelled()
{
return canceled;
}
@Override
public boolean isDone()
{
return done;
}
@Override
public T get() throws InterruptedException, ExecutionException
{
latch.await();
return get0();
}
@Override
public T get(long timeout, TimeUnit unit) throws InterruptedException, Executio... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\concurrent\FutureValue.java | 1 |
请完成以下Java代码 | public void сhangeOil(String oil) {
Assert.notNull(oil, "oil mustn't be null");
// ...
}
public void replaceBattery(CarBattery carBattery) {
Assert.isNull(carBattery.getCharge(), "to replace battery the charge must be null");
// ...
}
public void сhangeEngine(Engine eng... | }
public static void main(String[] args) {
Car car = new Car();
car.drive(50);
car.stop();
car.fuel();
car.сhangeOil("oil");
CarBattery carBattery = new CarBattery();
car.replaceBattery(carBattery);
car.сhangeEngine(new ToyotaEngine());
... | repos\tutorials-master\spring-5\src\main\java\com\baeldung\assertions\Car.java | 1 |
请完成以下Java代码 | public SetRemovalTimeToHistoricDecisionInstancesBuilder absoluteRemovalTime(Date removalTime) {
ensureNull(BadUserRequestException.class, "The removal time modes are mutually exclusive","mode", mode);
this.mode = Mode.ABSOLUTE_REMOVAL_TIME;
this.removalTime = removalTime;
return this;
}
@Override
... | public HistoricDecisionInstanceQuery getQuery() {
return query;
}
public List<String> getIds() {
return ids;
}
public Date getRemovalTime() {
return removalTime;
}
public Mode getMode() {
return mode;
}
public enum Mode {
CALCULATED_REMOVAL_TIME,
ABSOLUTE_REMOVAL_TIME,
CL... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\SetRemovalTimeToHistoricDecisionInstancesBuilderImpl.java | 1 |
请完成以下Spring Boot application配置 | okta.oauth2.issuer= //Auth server issuer URL
okta.oauth2.client-id= //Client ID of our Okta application
okta.oauth2.client-secret= //Client secret of our Okta application
okta.oauth2.redirect-uri=/authorization-code/callb | ack
#Okta Spring SDK configs
okta.client.orgUrl= //orgURL
okta.client.token= //token generated | repos\tutorials-master\spring-security-modules\spring-security-okta\src\main\resources\application.properties | 2 |
请完成以下Java代码 | protected List<ExecutableScript> getEnvScripts(ExecutableScript script, ScriptEngine scriptEngine) {
List<ExecutableScript> envScripts = getEnvScripts(script.getLanguage().toLowerCase());
if (envScripts.isEmpty()) {
envScripts = getEnvScripts(scriptEngine.getFactory().getLanguageName().toLowerCase());
... | *
* @param language the language
* @return the list of env scripts. Never null.
*/
protected List<ExecutableScript> initEnvForLanguage(String language) {
List<ExecutableScript> scripts = new ArrayList<>();
for (ScriptEnvResolver resolver : envResolvers) {
String[] resolvedScripts = resolver.re... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\scripting\env\ScriptingEnvironment.java | 1 |
请完成以下Java代码 | public void setVariableType(VariableType variableType) {
this.variableType = variableType;
}
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
public String getProcessInstanceId() {
return processInstanceId;
}
pu... | public Date getTime() {
return getCreateTime();
}
public ByteArrayRef getByteArrayRef() {
return byteArrayRef;
}
// common methods //////////////////////////////////////////////////////////
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricVariableInstanceEntityImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MainApplication {
private final BookstoreService bookstoreService;
public MainApplication(BookstoreService bookstoreService) {
this.bookstoreService = bookstoreService;
}
public static void main(String[] args) {
SpringApplication.run(MainApplication.class, args);
}
... | System.out.println("\nCount 'Anthology' authors: \n"
+ bookstoreService.countByGenre()
+ "\n\n");
System.out.println("\nDelete 'History' authors: \n"
+ bookstoreService.deleteByGenre()
+ "\n\n");
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootDerivedCountAndDelete\src\main\java\com\bookstore\MainApplication.java | 2 |
请完成以下Java代码 | public class ExecutionContextHolder {
protected static ThreadLocal<Stack<ExecutionContext>> executionContextStackThreadLocal = new ThreadLocal<>();
public static ExecutionContext getExecutionContext() {
return getStack(executionContextStackThreadLocal).peek();
}
public static boolean isExecut... | }
public static void removeExecutionContext() {
getStack(executionContextStackThreadLocal).pop();
}
protected static <T> Stack<T> getStack(ThreadLocal<Stack<T>> threadLocal) {
Stack<T> stack = threadLocal.get();
if (stack == null) {
stack = new Stack<>();
th... | repos\flowable-engine-main\modules\flowable-cdi\src\main\java\org\flowable\cdi\impl\context\ExecutionContextHolder.java | 1 |
请完成以下Java代码 | public int getM_Pricelist_Version_Base_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Pricelist_Version_Base_ID);
}
@Override
public void setM_PriceList_Version_ID (final int M_PriceList_Version_ID)
{
if (M_PriceList_Version_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_PriceList_Version_ID, null);
else
set_Va... | }
@Override
public java.lang.String getProcCreate()
{
return get_ValueAsString(COLUMNNAME_ProcCreate);
}
@Override
public void setProcessed (final boolean Processed)
{
set_Value (COLUMNNAME_Processed, Processed);
}
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Proce... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PriceList_Version.java | 1 |
请完成以下Java代码 | public SpinValueType getType() {
return (SpinValueType) super.getType();
}
public boolean isDeserialized() {
return isDeserialized;
}
public String getValueSerialized() {
return serializedValue;
}
public void setValueSerialized(String serializedValue) {
this.serializedValue = serializedVa... | }
public void setSerializationDataFormat(String serializationDataFormat) {
this.dataFormatName = serializationDataFormat;
}
public DataFormat<? extends Spin<?>> getDataFormat() {
if(isDeserialized) {
return DataFormats.getDataFormat(dataFormatName);
}
else {
throw new IllegalStateExc... | repos\camunda-bpm-platform-master\engine-plugins\spin-plugin\src\main\java\org\camunda\spin\plugin\variable\value\impl\SpinValueImpl.java | 1 |
请完成以下Java代码 | private String quoteIfNeeded(String s) {
if (s != null && s.contains(":")) { // TODO: broaded quote
return "\"" + s + "\"";
}
return s;
}
public @Nullable String get(String key) {
return this.values.get(key);
}
/* for testing */ Map<String, String> getValues() {
return this.values;
}
@... | return "Forwarded{" + "values=" + this.values + '}';
}
public String toHeaderValue() {
StringBuilder builder = new StringBuilder();
for (Map.Entry<String, String> entry : this.values.entrySet()) {
if (!builder.isEmpty()) {
builder.append(SEMICOLON);
}
builder.append(entry.getKey()).append(EQ... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\headers\ForwardedHeadersFilter.java | 1 |
请完成以下Java代码 | public Integer value1() {
return getId();
}
@Override
public String value2() {
return getTitle();
}
@Override
public String value3() {
return getDescription();
}
@Override
public Integer value4() {
return getAuthorId();
}
@Override
publ... | setAuthorId(value);
return this;
}
@Override
public ArticleRecord values(Integer value1, String value2, String value3, Integer value4) {
value1(value1);
value2(value2);
value3(value3);
value4(value4);
return this;
}
// -------------------------------... | repos\tutorials-master\persistence-modules\jooq\src\main\java\com\baeldung\jooq\model\tables\records\ArticleRecord.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public long executeCount(CommandContext commandContext) {
return batchServiceConfiguration.getBatchEntityManager().findBatchCountByQueryCriteria(this);
}
@Override
public List<Batch> executeList(CommandContext commandContext) {
return batchServiceConfiguration.getBatchEntityManager().findBa... | public String getSearchKey() {
return searchKey;
}
public String getSearchKey2() {
return searchKey2;
}
public Date getCreateTimeHigherThan() {
return createTimeHigherThan;
}
public Date getCreateTimeLowerThan() {
return createTimeLowerThan;
}
public S... | repos\flowable-engine-main\modules\flowable-batch-service\src\main\java\org\flowable\batch\service\impl\BatchQueryImpl.java | 2 |
请完成以下Java代码 | public void setExpirationListener(ExpirationListener listener) {
this.expirationListener = listener;
}
/**
* start the registration store, will start regular cleanup of dead registrations.
*/
@Override
public synchronized void start() {
if (!started) {
started = tr... | lock.readLock().unlock();
}
for (Registration reg : allRegs) {
if (!reg.isAlive()) {
// force de-registration
Deregistration removedRegistration = removeRegistration(reg.getId());
expirationListe... | repos\thingsboard-master\common\transport\lwm2m\src\main\java\org\thingsboard\server\transport\lwm2m\server\store\TbInMemoryRegistrationStore.java | 1 |
请完成以下Java代码 | public int getPickFrom_Warehouse_ID()
{
return get_ValueAsInt(COLUMNNAME_PickFrom_Warehouse_ID);
}
@Override
public void setQtyRejectedToPick (final @Nullable BigDecimal QtyRejectedToPick)
{
set_Value (COLUMNNAME_QtyRejectedToPick, QtyRejectedToPick);
}
@Override
public BigDecimal getQtyRejectedToPick() ... | /** NotFound = N */
public static final String REJECTREASON_NotFound = "N";
/** Damaged = D */
public static final String REJECTREASON_Damaged = "D";
@Override
public void setRejectReason (final @Nullable java.lang.String RejectReason)
{
set_Value (COLUMNNAME_RejectReason, RejectReason);
}
@Override
public ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_Picking_Job_Step_HUAlternative.java | 1 |
请完成以下Java代码 | public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
@Override
public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException
{
... | @param SalesRep_ID Aussendienst */
@Override
public void setSalesRep_ID (int SalesRep_ID)
{
if (SalesRep_ID < 1)
set_Value (COLUMNNAME_SalesRep_ID, null);
else
set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
}
/** Get Aussendienst.
@return Aussendienst */
@Override
public int... | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java-gen\de\metas\dunning\model\X_C_DunningDoc_Line.java | 1 |
请完成以下Java代码 | public void setPhone2 (final @Nullable java.lang.String Phone2)
{
set_Value (COLUMNNAME_Phone2, Phone2);
}
@Override
public java.lang.String getPhone2()
{
return get_ValueAsString(COLUMNNAME_Phone2);
}
@Override
public void setProcessing (final boolean Processing)
{
set_Value (COLUMNNAME_Processing, P... | {
set_Value (COLUMNNAME_Title, Title);
}
@Override
public java.lang.String getTitle()
{
return get_ValueAsString(COLUMNNAME_Title);
}
@Override
public void setUnlockAccount (final @Nullable java.lang.String UnlockAccount)
{
set_Value (COLUMNNAME_UnlockAccount, UnlockAccount);
}
@Override
public jav... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User.java | 1 |
请完成以下Java代码 | class Context {
private static Map<String, List<Row>> tables = new HashMap<>();
static {
List<Row> list = new ArrayList<>();
list.add(new Row("John", "Doe"));
list.add(new Row("Jan", "Kowalski"));
list.add(new Row("Dominic", "Doom"));
tables.put("people", list);
}
... | * No filters, match all columns.
*/
void clear() {
column = "";
columnMapper = matchAllColumns;
whereFilter = matchAnyString;
}
List<String> search() {
List<String> result = tables.entrySet()
.stream()
.filter(entry -> entry.getKey().equ... | repos\tutorials-master\patterns-modules\design-patterns-behavioral-2\src\main\java\com\baeldung\interpreter\Context.java | 1 |
请完成以下Java代码 | public class EdgeEventEntity extends BaseSqlEntity<EdgeEvent> implements BaseEntity<EdgeEvent> {
@Column(name = EDGE_EVENT_SEQUENTIAL_ID_PROPERTY)
protected long seqId;
@Column(name = EDGE_EVENT_TENANT_ID_PROPERTY)
private UUID tenantId;
@Column(name = EDGE_EVENT_EDGE_ID_PROPERTY)
private UUI... | this.edgeEventAction = edgeEvent.getAction();
this.entityBody = edgeEvent.getBody();
this.edgeEventUid = edgeEvent.getUid();
}
@Override
public EdgeEvent toData() {
EdgeEvent edgeEvent = new EdgeEvent(new EdgeEventId(this.getUuid()));
edgeEvent.setCreatedTime(createdTime);
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\model\sql\EdgeEventEntity.java | 1 |
请完成以下Java代码 | private Set<EDIDesadvPackId> generateLabelsInTrx()
{
if(!p_IsDefault && p_Counter <= 0)
{
throw new FillMandatoryException(PARAM_Counter);
}
final List<I_EDI_DesadvLine> desadvLines = getSelectedLines();
if (desadvLines.isEmpty())
{
throw new AdempiereException("@NoSelection@");
}
final DesadvL... | ediDesadvRecord.getDropShip_BPartner_ID(),
ediDesadvRecord.getC_BPartner_ID());
return BPartnerId.ofRepoId(bpartnerRepoId);
}
private List<I_EDI_DesadvLine> getSelectedLines()
{
final Set<Integer> lineIds = getSelectedLineIds();
return desadvBL.retrieveLinesByIds(lineIds);
}
private I_EDI_DesadvLine g... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\process\EDI_Desadv_GenerateSSCCLabels.java | 1 |
请完成以下Java代码 | public void setPosted (boolean Posted)
{
set_ValueNoCheck (COLUMNNAME_Posted, Boolean.valueOf(Posted));
}
/** Get Verbucht.
@return Posting status
*/
@Override
public boolean isPosted ()
{
Object oo = get_Value(COLUMNNAME_Posted);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boo... | @Override
public boolean isProcessing ()
{
Object oo = get_Value(COLUMNNAME_Processing);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Menge.
@param Qty
Quantity
*/
@Override
public void setQty ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_MatchPO.java | 1 |
请完成以下Java代码 | public void cancelReservedItems(Order order) {
log.info("cancelReservedItems: order={}", order);
for (OrderItem item : order.items()) {
inventoryService.cancelInventoryReservation(item.sku(), item.quantity());
}
}
@Override
public void returnOrderItems(Order order) {
... | null);
return paymentService.processPaymentRequest(request);
}
@Override
public RefundRequest createRefundRequest(PaymentAuthorization payment) {
log.info("createRefundRequest: payment={}", payment);
return paymentService.createRefundRequest(payment);
}
@Override
public... | repos\tutorials-master\saas-modules\temporal\src\main\java\com\baeldung\temporal\workflows\sboot\order\activities\OrderActivitiesImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProductLoader implements ApplicationListener<ContextRefreshedEvent> {
private ProductRepository productRepository;
private Logger log = LogManager.getLogger(ProductLoader.class);
@Autowired
public void setProductRepository(ProductRepository productRepository) {
this.productReposi... | shirt.setPrice(new BigDecimal("18.95"));
shirt.setImageUrl("https://springframework.guru/wp-content/uploads/2015/04/spring_framework_guru_shirt-rf412049699c14ba5b68bb1c09182bfa2_8nax2_512.jpg");
shirt.setProductId("235268845711068308");
productRepository.save(shirt);
log.info("Saved Shi... | repos\springbootwebapp-master\src\main\java\guru\springframework\bootstrap\ProductLoader.java | 2 |
请完成以下Java代码 | default @Nullable AcknowledgeMode getAckMode() {
return null;
}
/**
* Return a {@link ReplyPostProcessor} to post process a reply message before it is
* sent.
* @return the post processor.
* @since 2.2.5
*/
default @Nullable ReplyPostProcessor getReplyPostProcessor() {
return null;
}
/**
* Get th... | */
default @Nullable String getReplyContentType() {
return null;
}
/**
* Return whether the content type set by a converter prevails or not.
* @return false to always apply the reply content type.
* @since 2.3
*/
default boolean isConverterWinsContentType() {
return true;
}
} | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\listener\RabbitListenerEndpoint.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:h2:mem:mydb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.defer-datasource-initialization=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.... | es.hibernate.globally_quoted_identifiers=true
#spring.jpa.properties.hibernate.check_nullability=true
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console | repos\tutorials-master\persistence-modules\spring-boot-persistence-h2\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public PageData<AuditLog> findAuditLogsByTenantId(UUID tenantId, List<ActionType> actionTypes, TimePageLink pageLink) {
return DaoUtil.toPageData(
auditLogRepository.findByTenantId(
tenantId,
pageLink.getTextSearch(),
pageLi... | public void createPartition(AuditLogEntity entity) {
partitioningRepository.createPartitionIfNotExists(AUDIT_LOG_TABLE_NAME, entity.getCreatedTime(), TimeUnit.HOURS.toMillis(partitionSizeInHours));
}
@Override
protected Class<AuditLogEntity> getEntityClass() {
return AuditLogEntity.class;
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\audit\JpaAuditLogDao.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getColumnValue(Row row) {
if (row.isNull(index)) {
if (this.type == CassandraToSqlColumnType.BOOLEAN && !this.allowNullBoolean) {
return Boolean.toString(false);
} else {
return null;
}
} else {
switch (this.ty... | case BOOLEAN:
sqlInsertStatement.setBoolean(this.sqlIndex, Boolean.parseBoolean(value));
break;
case ENUM_TO_INT:
@SuppressWarnings("unchecked")
Enum<?> enumVal = Enum.valueOf(this.enumClass, value);
int ... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\install\migrate\CassandraToSqlColumn.java | 2 |
请完成以下Java代码 | public class JavaSecurityPemUtils {
public static RSAPrivateKey readPKCS8PrivateKey(File file) throws GeneralSecurityException, IOException {
String key = new String(Files.readAllBytes(file.toPath()), Charset.defaultCharset());
String privateKeyPEM = key
.replace("-----BEGIN PRIVAT... | public static RSAPublicKey readX509PublicKey(File file) throws GeneralSecurityException, IOException {
String key = new String(Files.readAllBytes(file.toPath()), Charset.defaultCharset());
String publicKeyPEM = key
.replace("-----BEGIN PUBLIC KEY-----", "")
.replaceAll(S... | repos\tutorials-master\core-java-modules\core-java-security\src\main\java\com\baeldung\pem\JavaSecurityPemUtils.java | 1 |
请完成以下Java代码 | public void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener) {
if (stateTransactionListeners==null) {
stateTransactionListeners = new HashMap<TransactionState, List<TransactionListener>>();
}
List<TransactionListener> transactionListeners = stateTransa... | fireTransactionEvent(TransactionState.ROLLINGBACK);
}
catch (Throwable exception) {
LOG.exceptionWhileFiringEvent(TransactionState.ROLLINGBACK, exception);
Context.getCommandInvocationContext().trySetThrowable(exception);
}
finally {
LOG.debugTransactionOperation("rollin... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cfg\standalone\StandaloneTransactionContext.java | 1 |
请完成以下Java代码 | protected boolean beforeSave(boolean newRecord)
{
if (newRecord && getParent().isComplete())
{
throw new AdempiereException("@ParentComplete@ @DD_OrderLine_ID@");
}
// Get Defaults from Parent
/*
* if (getC_BPartner_ID() == 0 || getC_BPartner_Location_ID() == 0
* || getM_Warehouse_ID() == 0)
* se... | String sql = "SELECT COALESCE(MAX(Line),0)+10 FROM DD_OrderLine WHERE DD_Order_ID=?";
int ii = DB.getSQLValue(get_TrxName(), sql, getDD_Order_ID());
setLine(ii);
}
return true;
} // beforeSave
/**
* Before Delete
*
* @return true if it can be deleted
*/
@Override
protected boolean beforeDele... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\eevolution\model\MDDOrderLine.java | 1 |
请完成以下Java代码 | public int getRecord_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/**
* ReplicationTrxStatus AD_Reference_ID=540491
* Reference name: EXP_ReplicationTrxStatus
*/
public static final int REPLICATIONTRXSTATUS_AD_Reference_ID=540491... | /** Set Replikationsstatus.
@param ReplicationTrxStatus Replikationsstatus */
@Override
public void setReplicationTrxStatus (java.lang.String ReplicationTrxStatus)
{
set_Value (COLUMNNAME_ReplicationTrxStatus, ReplicationTrxStatus);
}
/** Get Replikationsstatus.
@return Replikationsstatus */
@Override... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\adempiere\process\rpl\model\X_EXP_ReplicationTrxLine.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.