کدهای خود را به اشتراک بگذارید

vata2999
clean code iterable implementation
ایجاد شده 3 هفته پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
class Words implements Iterable<String> {
  private final String text;
  Words(String txt) {
    this.text = txt;
  }
  @Override
  public Iterator<String> iterator() {
    Set<String> words = new HashSet<>();
    for (String word : this.text.split(" ")) {
      words.add(word);
    }
vata2999
primefaces multiple selection with pagin #2
ایجاد شده 4 هفته پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<h:form id="commentListForm">
<p:dataTable id="commentDatatable" 
                                	 var="_item" 
                                	 value="#{commentQuery.resultList}" 
                                	 rowKey="#{_item.id}"
                                	 rowIndexVar="rowId"
                                	 sortBy="#{_item.id}" 
                                	 lazy="true"
                                	 sortMode="multiple"
                                     rows="10" 
                                     paginator="true"                                      
vata2999
primefaces multiple selection with pagin #1
ایجاد شده 4 هفته پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<h:form id="customersListTableForm">

									<p:dataTable var="item" 
										value="#{zoneHeaderUnAssign.customerWithThisZoneList}"
										paginatorPosition="bottom" rowsPerPageTemplate="5,10"
										sortBy="#{item.customerId}"
										emptyMessage="#{msgs['dataTable.emptyMessage']}"
										paginator="true" rows="10" id="customerListTable" lazy="true"
										selection="#{zoneHeaderUnAssign.selectedCustomers}"
										rowKey="#{item.customerId}">
										
vata2999
JSF event post validate
ایجاد شده 1 ماه پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<f:event
	listener="#{customerActionBean.validateCustomerDetail}"
	type="postValidate" />


public void validateCustomerDetail(ComponentSystemEvent event)
{
	FacesContext fc = FacesContext.getCurrentInstance();
	UIComponent components = event.getComponent();
        UIInput nationalNoInput = (UIInput) components.findComponent("nationalNo");
	if(!valid)
vata2999
RxJava Observable
ایجاد شده 1 ماه پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
final int cnt = 10;
        Observable<Integer> ob = Observable.create(new SyncOnSubscribe<Integer, Integer>() {
            @Override
            protected Integer generateState()
            {
                return 0;
            }
            @Override
            protected Integer next(Integer state, Observer<? super Integer> observer)
            {
                state++;
vata2999
Spring REST DeferredResult CompletableFuture
ایجاد شده 1 ماه پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
package com;

import java.io.Serializable;
import java.util.concurrent.CompletableFuture;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.async.DeferredResult;

@RestController
vata2999
oracle pl procedure
ایجاد شده 2 ماه پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
--SET SERVEROUTPUT ON

DECLARE
   v_sales_type      varchar2(50);
   v_next_val       number(20);
   v_date           Date;   
BEGIN
   DBMS_OUTPUT.PUT_LINE ('start');
FOR i
      IN (
vata2999
OneToOne between two tables with shared primary key
ایجاد شده 2 ماه پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
public class Validation {

    private Long validationId;
    private User user;

    @Id
    @GeneratedValue(generator="SharedPrimaryKeyGenerator")
    @GenericGenerator(name="SharedPrimaryKeyGenerator",strategy="foreign",parameters =  @Parameter(name="property", value="user"))
    @Column(name = "VALIDATION_ID", unique = true, nullable = false)
    public Long getValidationId(){
        return validationId;
vata2999
Oracle Dependecies of a Table
ایجاد شده 2 ماه پیش
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
select
 a.owner||'.'||a.table_name "Referenced Table"
,b.owner||'.'||b.table_name "Referenced by"
,b.constraint_name "Foreign Key"
from all_constraints a, all_constraints b 
where 
b.constraint_type = 'R'
and a.constraint_name = b.r_constraint_name 
and b.table_name='CRM_CUSTOMER' -- Table name 
order by a.owner||'.'||a.table_name
Idin72
طریقه or کردن دو predicateList در jpa
ایجاد شده 2 ماه پیش
1
predicateList.add(cb.or(cb.and(predicateList1.toArray(new Predicate[predicateList1.size()])), cb.and(predicateList2.toArray(new Predicate[predicateList2.size()]))));
لطفا منتظر بمانید