Tabnine Logo
GenericEntityService.tryValidateProperty
Code IndexAdd Tabnine to your IDE (free)

How to use
tryValidateProperty
method
in
org.hswebframework.web.service.GenericEntityService

Best Java code snippets using org.hswebframework.web.service.GenericEntityService.tryValidateProperty (Showing top 2 results out of 315)

origin: hs-web/hsweb-framework

@Override
public PK insert(E entity) {
  if (!StringUtils.isEmpty(entity.getId())) {
    if ((entity.getId() instanceof String) && !StringUtils.isEmpty(entity.getId())) {
      tryValidateProperty(entity.getId().toString().matches("[a-zA-Z0-9_\\-]+"), "id", "只能由数字,字母,下划线,和-组成");
    }
    tryValidateProperty(selectByPk(entity.getId()) == null, "id", entity.getId() + "已存在");
  }
  if (StringUtils.isEmpty(entity.getId()) && getIDGenerator() != null) {
    entity.setId(getIDGenerator().generate());
  }
  if (entity instanceof RecordCreationEntity) {
    ((RecordCreationEntity) entity).setCreateTimeNow();
  }
  tryValidate(entity, CreateGroup.class);
  getDao().insert(entity);
  return entity.getId();
}
origin: org.hswebframework.web/hsweb-commons-service-simple

@Override
public PK insert(E entity) {
  if (!StringUtils.isEmpty(entity.getId())) {
    if ((entity.getId() instanceof String) && !StringUtils.isEmpty(entity.getId())) {
      tryValidateProperty(entity.getId().toString().matches("[a-zA-Z0-9_\\-]+"), "id", "只能由数字,字母,下划线,和-组成");
    }
    tryValidateProperty(selectByPk(entity.getId()) == null, "id", entity.getId() + "已存在");
  }
  if (StringUtils.isEmpty(entity.getId()) && getIDGenerator() != null) {
    entity.setId(getIDGenerator().generate());
  }
  if (entity instanceof RecordCreationEntity) {
    ((RecordCreationEntity) entity).setCreateTimeNow();
  }
  tryValidate(entity, CreateGroup.class);
  getDao().insert(entity);
  return entity.getId();
}
org.hswebframework.web.serviceGenericEntityServicetryValidateProperty

Popular methods of GenericEntityService

  • deleteByPk
  • updateByPk
  • insert
  • saveOrUpdate
  • selectByPk
  • count
  • createQuery
  • createUpdate
  • dataExisted
  • getDao
  • getEntityInstanceType
  • getIDGenerator
    获取ID生成器,在insert的时候,如果ID为空,则调用生成器进行生成
  • getEntityInstanceType,
  • getIDGenerator,
  • select,
  • tryValidate

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Menu (java.awt)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now